/* 对接配置中心 —— 浅色商务风，与 sop.css 同一套色板 */
:root {
  --cnn-line: #e6ebf2;
  --cnn-line2: #eef2f7;
  --cnn-txt: #0f172a;
  --cnn-sub: #64748b;
  --cnn-dim: #94a3b8;
  --cnn-blue: #2563eb;
  --cnn-green: #059669;
  --cnn-amber: #d97706;
  --cnn-red: #dc2626;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { font-size: 19px; font-weight: 650; color: var(--cnn-txt); margin: 0 0 4px; letter-spacing: -.2px; }
.page-head p { font-size: 13px; color: var(--cnn-sub); margin: 0; }

/* ---- 顶部统计条：一行等分，不换行 ---- */
.cnn-strip {
  display: flex; flex-wrap: nowrap; gap: 10px; margin-bottom: 14px;
}
.cnn-stat {
  flex: 1 1 0; min-width: 0; background: #fff; border: 1px solid var(--cnn-line);
  border-radius: 12px; padding: 12px 14px; display: flex; align-items: baseline;
  gap: 6px; flex-wrap: wrap;
}
.cnn-stat > span { font-size: 12px; color: var(--cnn-sub); width: 100%; }
.cnn-stat > b { font-size: 21px; font-weight: 680; color: var(--cnn-txt); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.cnn-stat > b.blue { color: var(--cnn-blue); }
.cnn-stat > b.green { color: var(--cnn-green); }
.cnn-stat > b.amber { color: var(--cnn-amber); }
.cnn-stat > em { font-size: 11.5px; color: var(--cnn-dim); font-style: normal; }

.cnn-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f7faff; border: 1px solid #e2ecfb; border-left: 3px solid var(--cnn-blue);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 20px;
  font-size: 12.5px; line-height: 1.65; color: #475569;
}
.cnn-note b { color: #1e3a8a; font-weight: 620; flex: none; }
.cnn-note span { color: #475569; }

.cnn-sec-hd { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
.cnn-sec-hd h3 { font-size: 14.5px; font-weight: 640; color: var(--cnn-txt); margin: 0; }
.cnn-sec-hd span { font-size: 12px; color: var(--cnn-dim); }

/* ---- 卡片网格 ---- */
.cnn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.cnn-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cnn-card {
  background: #fff; border: 1px solid var(--cnn-line); border-radius: 14px;
  padding: 14px 15px 12px; cursor: pointer; transition: .18s ease; position: relative;
  display: flex; flex-direction: column; gap: 9px;
}
.cnn-card:hover { border-color: #c7d7f0; box-shadow: 0 6px 20px rgba(37, 99, 235, .08); transform: translateY(-2px); }
.cnn-card.on::after {
  content: ''; position: absolute; left: 15px; right: 15px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--cnn-blue), #60a5fa); border-radius: 2px 2px 0 0;
}

.cnn-card-hd { display: flex; align-items: center; gap: 9px; }
.cnn-abbr {
  width: 34px; height: 34px; flex: none; border-radius: 9px; border: 1px solid transparent;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: -.2px;
}
.cnn-abbr.lg { width: 42px; height: 42px; font-size: 12.5px; border-radius: 11px; }
.cnn-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cnn-card-title b { font-size: 13.5px; font-weight: 640; color: var(--cnn-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnn-card-title span { font-size: 11px; color: var(--cnn-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cnn-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11px; font-weight: 560; padding: 3px 8px; border-radius: 20px;
  background: #f1f5f9; color: var(--cnn-sub); border: 1px solid var(--cnn-line);
}
.cnn-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.cnn-badge.ok { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.cnn-badge.info { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.cnn-badge.warn { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.cnn-badge.bad { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }

.cnn-card-scene {
  font-size: 12px; line-height: 1.6; color: var(--cnn-sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}

.cnn-ents { display: flex; flex-wrap: wrap; gap: 5px; }
.cnn-ents span {
  font-size: 10.5px; color: #475569; background: #f8fafc; border: 1px solid var(--cnn-line2);
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.cnn-ents span.more { color: var(--cnn-blue); background: #eff6ff; border-color: #dbeafe; }
.cnn-ents.wide span { font-size: 11.5px; padding: 3px 9px; }

.cnn-card-ft { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.cnn-prog { flex: 1; height: 4px; background: #eef2f7; border-radius: 3px; overflow: hidden; }
.cnn-prog i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 3px; transition: .3s; }
.cnn-prog-t { font-size: 10.5px; color: var(--cnn-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cnn-time { font-size: 10.5px; color: var(--cnn-dim); }
.cnn-go { font-size: 11.5px; color: var(--cnn-blue); font-weight: 560; opacity: 0; transition: .15s; }
.cnn-card:hover .cnn-go { opacity: 1; }

.cnn-foot { font-size: 11.5px; color: var(--cnn-dim); line-height: 1.7; padding-top: 4px; border-top: 1px dashed var(--cnn-line2); }

/* ---- 抽屉 ---- */
.cnn-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .32); z-index: 300; animation: cnnFade .18s ease; }
@keyframes cnnFade { from { opacity: 0 } to { opacity: 1 } }

.cnn-drw {
  position: fixed; top: 0; right: 0; bottom: 0; width: 580px; max-width: 94vw;
  background: #fff; z-index: 301; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(15, 23, 42, .16);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.32, .72, 0, 1);
}
.cnn-drw.open { transform: translateX(0); }

.cnn-drw-hd {
  display: flex; align-items: center; gap: 11px; padding: 16px 18px;
  border-bottom: 1px solid var(--cnn-line); flex: none;
}
.cnn-drw-hd > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cnn-drw-hd b { font-size: 15px; font-weight: 650; color: var(--cnn-txt); }
.cnn-drw-hd span { font-size: 11.5px; color: var(--cnn-dim); }
.cnn-x {
  border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--cnn-dim);
  cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.cnn-x:hover { color: var(--cnn-txt); background: #f1f5f9; }

.cnn-drw-body { flex: 1; overflow-y: auto; padding: 16px 18px 8px; }

.cnn-block { margin-bottom: 18px; }
.cnn-block-hd {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 620; color: var(--cnn-txt); margin-bottom: 9px;
}
.cnn-block-hd svg { color: var(--cnn-dim); }

.cnn-steps { margin: 0; padding-left: 18px; }
.cnn-steps li { font-size: 12.5px; line-height: 1.75; color: #475569; margin-bottom: 3px; }

.cnn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cnn-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cnn-field label { font-size: 11.5px; color: var(--cnn-sub); font-weight: 520; }
.cnn-field label .req { color: var(--cnn-red); margin-left: 2px; font-weight: 700; }
.cnn-field input, .cnn-field select {
  height: 34px; border: 1px solid var(--cnn-line); border-radius: 8px; padding: 0 10px;
  font-size: 12.5px; color: var(--cnn-txt); background: #fff; width: 100%; box-sizing: border-box;
  transition: .15s; font-family: inherit;
}
.cnn-field input:focus, .cnn-field select:focus {
  outline: none; border-color: #93b4f0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.cnn-field input::placeholder { color: #c0cad8; }
.cnn-hint { font-size: 10.5px; color: var(--cnn-dim); line-height: 1.5; }
.cnn-file { display: flex; align-items: center; gap: 8px; }
.cnn-file input[type=file] { font-size: 11.5px; height: auto; padding: 6px; }
.cnn-file-t { font-size: 10.5px; color: var(--cnn-dim); }

.cnn-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #475569; cursor: pointer; }
.cnn-switch input { width: 15px; height: 15px; accent-color: var(--cnn-blue); }
.cnn-env { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--cnn-sub); }
.cnn-env select { height: 30px; border: 1px solid var(--cnn-line); border-radius: 7px; padding: 0 8px; font-size: 12px; }

/* ---- 测试结果 ---- */
.cnn-result:empty { display: none; }
.cnn-res { border-radius: 10px; padding: 11px 13px; margin-bottom: 18px; border: 1px solid; }
.cnn-res.ok { background: #f0fdf4; border-color: #d1fae5; }
.cnn-res.info { background: #f8fafc; border-color: var(--cnn-line); }
.cnn-res.bad { background: #fef2f2; border-color: #fee2e2; }
.cnn-res-hd { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; color: var(--cnn-txt); }
.cnn-res ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cnn-res li { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.6; }
.cnn-res li .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: none; }
.cnn-res li.ok .dot { background: var(--cnn-green); }
.cnn-res li.no .dot { background: var(--cnn-red); }
.cnn-res li b { color: #334155; font-weight: 580; flex: none; min-width: 72px; }
.cnn-res li em { color: var(--cnn-sub); font-style: normal; }
.cnn-testing { font-size: 12.5px; color: var(--cnn-sub); padding: 10px 12px; background: #f8fafc; border-radius: 9px; margin-bottom: 18px; }
.cnn-test-fail { font-size: 12.5px; color: #b91c1c; padding: 10px 12px; background: #fef2f2; border-radius: 9px; margin-bottom: 18px; }

/* ---- 日志 ---- */
.cnn-logs { display: flex; flex-direction: column; gap: 5px; max-height: 168px; overflow-y: auto; }
.cnn-log { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; padding: 5px 8px; background: #fafbfc; border-radius: 6px; }
.cnn-log .t { color: var(--cnn-dim); font-variant-numeric: tabular-nums; flex: none; }
.cnn-log .a { flex: none; font-weight: 560; }
.cnn-log .a.ok { color: var(--cnn-green); }
.cnn-log .a.no { color: var(--cnn-red); }
.cnn-log .m { color: var(--cnn-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnn-empty { font-size: 12px; color: var(--cnn-dim); padding: 6px 2px; }

.cnn-drw-ft {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--cnn-line); background: #fdfdfe;
}
.cnn-doc { font-size: 11.5px; color: var(--cnn-blue); text-decoration: none; }
.cnn-doc:hover { text-decoration: underline; }
.cnn-btns { display: flex; gap: 8px; }

/* 窄屏 */
@media (max-width: 1280px) {
  .cnn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .cnn-grid, .cnn-grid.two { grid-template-columns: 1fr; }
  .cnn-strip { flex-wrap: wrap; }
  .cnn-stat { flex: 1 1 40%; }
  .cnn-fields { grid-template-columns: 1fr; }
}

/* ---- 抽屉：厂商切换 + 表单/清单两视图（2026-11-29） ----
   参考客户常见做法（简道云那类）：先选厂商，再出该厂商的字段。
   这里做成抽屉内的下拉，比再套一层弹窗少一次点击，也不会丢掉已填的值。 */
.cnn-vendor {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; background: #f8fafc; border-bottom: 1px solid var(--cnn-line); flex: none;
}
.cnn-vendor > span { font-size: 11.5px; color: var(--cnn-dim); white-space: nowrap; }
.cnn-vendor select {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; font-size: 12.5px;
  border: 1px solid var(--cnn-line); border-radius: 8px; background: #fff; color: var(--cnn-txt);
  font-family: inherit; cursor: pointer;
}
.cnn-vendor select:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }

.cnn-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 18px; border-bottom: 1px solid var(--cnn-line); flex: none;
}
.cnn-tabs button {
  position: relative; border: none; background: transparent; cursor: pointer;
  padding: 10px 2px; margin-right: 16px; font-size: 12.5px; color: var(--cnn-dim);
  font-family: inherit; transition: color .15s;
}
.cnn-tabs button:hover { color: var(--cnn-txt); }
.cnn-tabs button.on { color: var(--cnn-blue); font-weight: 560; }
.cnn-tabs button.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--cnn-blue); border-radius: 2px;
}
.cnn-tabs-tip { margin-left: auto; font-size: 11px; color: #9aa8bb; }

/* 表单改成单列：字段说明是长句（「去哪拿」），两列一挤就折成四行，反而看不清 */
.cnn-drw .cnn-fields { grid-template-columns: 1fr; gap: 12px; }

/* ---- 资料清单表 ---- */
.cnn-tbl-wrap { border: 1px solid var(--cnn-line); border-radius: 10px; overflow: hidden; }
.cnn-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.cnn-tbl thead th {
  background: #f8fafc; text-align: left; font-weight: 560; color: var(--cnn-sub);
  font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--cnn-line); white-space: nowrap;
}
.cnn-tbl td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; color: #475569; }
.cnn-tbl tr:last-child td { border-bottom: none; }
.cnn-tbl td b { font-weight: 560; color: var(--cnn-txt); }
.cnn-tbl .cnn-where { font-size: 11.5px; line-height: 1.65; color: #64748b; max-width: 260px; }
.cnn-tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #94a3b8; word-break: break-all; }
.cnn-req { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: #fef2f2; color: #dc2626; white-space: nowrap; }
.cnn-opt { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: #94a3b8; white-space: nowrap; }
.cnn-need { display: inline-block; font-size: 10px; padding: 1px 5px; margin-left: 5px; border-radius: 4px; background: #eff6ff; color: #2563eb; }

.cnn-note-box {
  font-size: 12px; line-height: 1.75; color: #475569; background: #f8fafc;
  border: 1px dashed var(--cnn-line2); border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- 选厂商弹窗 ---- */
.cnn-pick { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 12px 0; max-height: 52vh; overflow-y: auto; }
.cnn-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--cnn-line); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.cnn-pick-item:hover { border-color: #bfdbfe; background: #f8fbff; transform: translateY(-1px); }
.cnn-pick-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cnn-pick-item b { font-size: 13px; font-weight: 560; color: var(--cnn-txt); }
.cnn-pick-item span { font-size: 11px; color: var(--cnn-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnn-pick-item em { font-size: 10.5px; color: #9aa8bb; font-style: normal; white-space: nowrap; }
@media (max-width: 720px) { .cnn-pick { grid-template-columns: 1fr; } }

.hide { display: none !important; }

/* 清单表定列宽：参数名和「去哪拿」是长句，不定宽会被示例列挤成一行三个字 */
.cnn-tbl { table-layout: fixed; }
.cnn-tbl th:nth-child(1), .cnn-tbl td:nth-child(1) { width: 20%; }
.cnn-tbl th:nth-child(2), .cnn-tbl td:nth-child(2) { width: 9%; }
.cnn-tbl th:nth-child(3), .cnn-tbl td:nth-child(3) { width: 46%; }
.cnn-tbl th:nth-child(4), .cnn-tbl td:nth-child(4) { width: 25%; }
.cnn-tbl td { word-break: break-word; }

/* 清单表定列宽：参数名和「去哪拿」是长句，不定宽会被示例列挤成一行三个字 */
.cnn-tbl { table-layout: fixed; }
.cnn-tbl th:nth-child(1), .cnn-tbl td:nth-child(1) { width: 20%; }
.cnn-tbl th:nth-child(2), .cnn-tbl td:nth-child(2) { width: 9%; }
.cnn-tbl th:nth-child(3), .cnn-tbl td:nth-child(3) { width: 46%; }
.cnn-tbl th:nth-child(4), .cnn-tbl td:nth-child(4) { width: 25%; }
.cnn-tbl td { word-break: break-word; }
