/* 电子签合同中心 · 样式（无构建，纯 CSS） */

:root {
  --brand: #2b6cf6;
  --brand-dark: #1f57cc;
  --brand-light: #eaf1ff;
  --ink: #1f2733;
  --ink-2: #303133;
  --ink-3: #5b6474;
  --gray: #8a94a6;
  --line: #e6e8eb;
  --line-2: #ebeef5;
  --bg: #f4f6f9;

  --el-color-primary: #2b6cf6;
  --el-color-primary-light-3: #6592f9;
  --el-color-primary-light-5: #95b5fb;
  --el-color-primary-light-7: #c5d7fc;
  --el-color-primary-light-8: #dde7fd;
  --el-color-primary-light-9: #eaf1ff;
  --el-color-primary-dark-2: #1f57cc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink-2);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.boot { padding: 60px 0; text-align: center; color: var(--gray); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 224px;
  flex: 0 0 224px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width .18s ease, flex-basis .18s ease;
  overflow: hidden;
}
.side.collapsed { width: 64px; flex-basis: 64px; }

.brand {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.logo {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4c8bfd, var(--brand));
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: .2px; }

.side-menu { border-right: 0; flex: 1; padding-top: 6px; }
.side-menu .el-menu-item { height: 42px; line-height: 42px; margin: 2px 8px; border-radius: 6px; color: var(--ink-3); }
.side-menu .el-menu-item:hover { background: #f5f7fa; }
.side-menu .el-menu-item.is-active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.side-menu .el-menu-item.is-active .mi { color: var(--brand); }
.mi { display: inline-block; width: 22px; text-align: center; margin-right: 6px; color: #a8b0bd; font-size: 14px; }

.side-foot {
  flex: 0 0 auto;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--gray);
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: #c0c4cc; flex: 0 0 8px; }
.mode-dot.mock { background: #e6a23c; }
.mode-dot.sandbox { background: var(--brand); }
.mode-dot.prod { background: #529b2e; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex: 0 0 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  position: sticky; top: 0; z-index: 20;
}
.collapse-btn { width: 24px; text-align: center; font-size: 17px; color: var(--ink-3); cursor: pointer; user-select: none; }
.collapse-btn:hover { color: var(--brand); }
.crumbs { font-size: 13px; color: var(--gray); }
.crumbs .sep { margin: 0 6px; color: #c8ccd4; }
.crumb-root { color: var(--gray); }
.crumb-cur { color: var(--ink-2); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who { color: var(--ink-2); }

.content { flex: 1; padding: 16px 18px 30px; min-width: 0; }

/* ---------------- 通用文字/间距 ---------------- */
.page-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.page-title .sub { font-weight: 400; font-size: 12px; color: var(--gray); margin-left: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.muted { color: #909399; }
.danger-text { color: #f56c6c; }
.warn-text { color: #e6961d; }
.mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; }
.mb6 { margin-bottom: 6px; } .mb10 { margin-bottom: 10px; }
.panel-inner { background: #fff; border: 1px solid #e6eaf0; border-radius: 8px; padding: 14px 16px; margin-top: 12px; }
.ml6 { margin-left: 6px; } .ml10 { margin-left: 10px; }
.w120 { width: 120px; } .w130 { width: 130px; } .w150 { width: 150px; }
.w160 { width: 160px; } .w180 { width: 180px; }
.w200 { width: 200px; } .w240 { width: 240px; } .w260 { width: 260px; }

/* ---------------- 卡片/统计 ---------------- */
.panel { margin-bottom: 14px; border-radius: 8px; }
.panel .el-card__header { padding: 12px 16px; }
.panel-t { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.panel-more { float: right; }
.empty { text-align: center; color: #a8b0bd; padding: 26px 0; font-size: 13px; }

.stat-row { margin-bottom: 14px; }
.stat {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 13px 15px;
  cursor: pointer;
  transition: box-shadow .16s, transform .16s;
}
.stat:hover { box-shadow: 0 4px 14px rgba(31, 39, 51, .08); transform: translateY(-1px); }
.stat-num { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--gray); margin-top: 5px; }
.stat.warn .stat-num { color: #d98b00; }
.stat.info .stat-num { color: var(--brand); }
.stat.ok .stat-num { color: #4f9a2a; }
.stat.muted .stat-num { color: #909399; }
.stat.bad .stat-num { color: #d93939; }

/* ---------------- 工具栏 / 筛选 ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar .el-button { margin-left: 0; }
.toolbar .el-button + .el-button { margin-left: 0; }

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.filters .el-button { margin-left: 0; }
.filters .el-select, .filters .el-input, .filters .el-date-editor { flex: 0 0 auto; }
.filters .el-checkbox { margin-right: 0; }

.grid { border-radius: 8px; }
.grid .el-table__header th {
  background: #f7f8fa !important;
  color: var(--ink-3);
  font-weight: 600;
}

.pager { margin-top: 14px; display: flex; justify-content: flex-end; }

/* 表格里的签署方单元格：两行紧凑，不换行 */
.signer-cell {
  line-height: 15px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signer-cell .sn { color: var(--ink-2); }
.signer-cell .mono { font-size: 11px; }
.grid .cell { line-height: 18px; }

/* ---------------- 状态徽标 ---------------- */
.st {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.st-0 { background: #fff5e6; color: #b87503; }
.st-1 { background: var(--brand-light); color: var(--brand); }
.st-2 { background: #eaf7ee; color: #4f9a2a; }
.st-3 { background: #f2f3f5; color: #7d8590; }
.st-4 { background: #fdecec; color: #d93939; }
.st-6 { background: #f4f4f5; color: #6b7280; }
.st-need { background:#fff4e5; color:#c27200; }
.st-7 { background: #f2f3f5; color: #7d8590; }

.erp-0 { color: #c0c4cc; }
.erp-1 { color: #4f9a2a; }
.erp-2 { color: #f56c6c; }

/* ---------------- 抽屉/详情 ---------------- */
.sec-t {
  font-weight: 600; font-size: 13px; color: var(--ink-2);
  border-left: 3px solid var(--brand);
  padding-left: 8px;
  margin: 18px 0 10px;
}
.json {
  background: #f7f9fc;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 12px;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #3b4453;
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow: auto;
}
.drawer-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-actions .el-button { margin-left: 0; }

/* ---------------- 批量发起向导 ---------------- */
.steps { margin-bottom: 14px; }
.narrow-form { max-width: 920px; }
.autofill { width: 100%; max-width: 780px; }
.form-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.form-foot .el-button { margin-left: 0; }

.upload-box { max-width: 780px; }
.upload-box .el-upload, .upload-box .el-upload-dragger { width: 100%; }
.upload-box .el-upload-dragger { padding: 26px 16px; }
.up-icon { font-size: 32px; color: #a8b8d8; line-height: 1; }
.up-t { font-size: 14px; color: var(--ink-2); margin: 8px 0 5px; }
.file-chip {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 12px;
  background: #f2f7ff;
  border: 1px solid #d6e4ff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.preview { margin-top: 18px; }
.mini-stat {
  background: #f7f9fc;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.mini-stat b { display: block; font-size: 20px; color: var(--ink); line-height: 1.3; }
.mini-stat span { font-size: 12px; color: var(--gray); }
.mini-stat.ok b { color: #4f9a2a; }
.mini-stat.bad b { color: #d93939; }

/* 客户管理页的统计条：一行 6 个 */
.cust-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.cust-stats > div {
  background: #f7f9fc;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.cust-stats b { display: block; font-size: 20px; color: var(--ink); line-height: 1.3; }
.cust-stats span { font-size: 12px; color: var(--gray); }
.w140 { width: 140px; }

.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.row-actions .el-button { margin-left: 0; }

.confirm-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  background: #f7f9fc;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
}
.confirm-summary span { display: block; font-size: 12px; }
.confirm-summary b { font-size: 15px; color: var(--ink); }

.launch-result { margin-top: 18px; }

/* ---------------- 接入说明 ---------------- */
.doc h3 {
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  margin: 20px 0 8px;
}
.doc h3:first-child { margin-top: 4px; }
.doc p { font-size: 13px; line-height: 1.75; color: var(--ink-3); margin: 6px 0; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0 4px;
}
.doc-table th, .doc-table td {
  border: 1px solid var(--line-2);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.doc-table th { background: #f7f8fa; font-weight: 600; color: var(--ink-3); }
.doc-table td.mono { font-size: 12px; color: var(--brand); }
.doc-ol { font-size: 13px; line-height: 1.9; color: var(--ink-3); padding-left: 18px; margin: 6px 0; }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 1280px) {
  .stat-row .el-col { max-width: 50%; flex: 0 0 50%; margin-bottom: 10px; }
  .confirm-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side { width: 64px; flex-basis: 64px; }
  .brand-text, .side-foot { display: none !important; }
  .content { padding: 12px; }
}
