@import url("./backend_pagination.css");
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #23437e;
}
.backend-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 36px;
}
.simple-card,
.login-card {
  background: linear-gradient(180deg, #4ea3ff 0%, #8fc1f5 28%, #d8ebfa 55%, #f8fbff 100%);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.login-card {
  max-width: 460px;
  margin: 40px auto 0;
}
.page-title {
  margin: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
}
.page-subtitle {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  line-height: 1.6;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 16px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
}
.notice-box,
.error-box,
.json-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
}
.error-box {
  color: #c93d3d;
}
.error-box-large {
  padding: 18px;
  text-align: left;
}
.error-title {
  color: #c93d3d;
  font-size: 20px;
  font-weight: 700;
}
.error-desc {
  margin-top: 10px;
  color: #7a3f3f;
  font-size: 15px;
  line-height: 1.6;
}
.login-form,
.action-form {
  margin-top: 20px;
}
.login-input {
  display: block;
  width: 100%;
  height: 48px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255,255,255,0.92);
  outline: none;
}
.primary-btn,
.secondary-btn,
.primary-link-btn,
.secondary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 23px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primary-btn,
.primary-link-btn {
  background: linear-gradient(180deg, #5ca8ff 0%, #0d63f1 100%);
  color: #fff;
}
.secondary-btn,
.secondary-link-btn {
  background: rgba(255,255,255,0.86);
  color: #2750ab;
  border: 1px solid rgba(39,80,171,0.12);
}
.full-width-btn {
  width: 100%;
}
.action-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.action-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.stat-box {
  background: rgba(255,255,255,0.86);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
}
.stat-num {
  color: #0d63f1;
  font-size: 28px;
  font-weight: 700;
}
.stat-label {
  margin-top: 6px;
  color: #5a73a2;
  font-size: 14px;
}
.table-wrap {
  margin-top: 22px;
  overflow: auto;
  background: rgba(255,255,255,0.86);
  border-radius: 18px;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1600px;
}
.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(39,80,171,0.08);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  color: #355a9c;
}
.data-table th {
  color: #214898;
  font-weight: 700;
  background: rgba(236,244,255,0.8);
}
.data-table pre {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
}
.empty-row {
  text-align: center;
}
.mono {
  font-family: Consolas, monospace;
}
.report-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.86);
  overflow: hidden;
}
.report-card-html {
  padding: 16px;
}
.report-header {
  border-radius: 18px;
  background: linear-gradient(180deg, #5ca8ff 0%, #4b98ef 100%);
  padding: 16px 16px 14px;
}
.report-title {
  color: #ffffff;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  line-height: 1.5;
}
.report-form-card {
  text-align: left;
}
.report-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-row {
  display: grid;
  grid-template-columns: 240px minmax(420px, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 760px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e6f0ff;
  padding: 14px 16px;
}
.report-row-label {
  color: #5a73a2;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-row-value {
  color: #214898;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-note {
  margin-top: 16px;
  border-radius: 16px;
  background: #eef5ff;
  padding: 14px 16px;
  text-align: left;
}
.report-note-label {
  display: inline-block;
  color: #355a9c;
  font-size: 14px;
  font-weight: 700;
  margin-right: 8px;
}
.report-note-text {
  color: #5a73a2;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.detail-grid > div,
.notice-box,
.data-table td,
.data-table th,
.page-subtitle,
.report-card {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 768px) {
  .backend-page {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 10px 26px;
  }
  .simple-card,
  .login-card {
    border-radius: 22px;
    padding: 18px;
  }
  .page-title {
    font-size: 24px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .dashboard-head {
    flex-direction: column;
  }
  .action-inline,
  .action-form {
    flex-direction: column;
    align-items: stretch;
  }
  .primary-btn,
  .secondary-btn,
  .primary-link-btn,
  .secondary-link-btn {
    width: 100%;
  }
  .report-card {
    padding: 14px;
    border-radius: 18px;
  }
  .report-card-html {
    padding: 12px;
  }
  .report-header {
    padding: 14px 14px 12px;
    border-radius: 16px;
  }
  .report-title {
    font-size: 20px;
  }
  .report-meta {
    gap: 6px 12px;
    font-size: 12px;
  }
  .report-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
  }
  .report-row-label {
    font-size: 13px;
  }
  .report-row-value {
    font-size: 17px;
    line-height: 1.6;
  }
  .report-note {
    border-radius: 14px;
    padding: 12px 14px;
  }
  .data-table {
    min-width: 1100px;
  }
}


.backend-report-title {
  color: #214898;
  font-size: 22px;
}
.qr-upload-card {
  margin-top: 22px;
}
.qr-upload-form .login-input {
  margin-bottom: 0;
}


.qr-upload-form .login-input {
  min-width: 220px;
}
@media (max-width: 768px) {
  .qr-upload-form .login-input {
    min-width: 0;
    width: 100%;
  }
}


.backend-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  min-width: 260px;
}

.backend-item-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(248,251,255,0.95);
}

.backend-item-label {
  color: #5a73a2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-word;
}

.backend-item-value {
  color: #214898;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.backend-item-value-full {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .backend-item-row {
    grid-template-columns: 1fr;
  }
}


/* Mobile risk report visibility fix */
.mobile-risk-report,
.mobile-risk-report * {
  box-sizing: border-box;
}

.mobile-risk-report .report-list {
  overflow: visible;
}

.mobile-risk-report .report-row {
  width: 100%;
}

.mobile-risk-report .report-row-label,
.mobile-risk-report .report-row-value {
  overflow: visible;
  text-overflow: unset;
}

@media (max-width: 768px) {
  .mobile-risk-report {
    overflow: visible;
  }

  .mobile-risk-report .report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    width: 100%;
  }

  .mobile-risk-report .report-row {
    display: block;
    min-width: 0 !important;
    width: 100% !important;
    padding: 12px;
    border-radius: 14px;
  }

  .mobile-risk-report .report-row-label {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.5;
  }

  .mobile-risk-report .report-row-value {
    display: block;
    width: 100%;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.7;
  }

  .mobile-risk-report .report-note {
    margin-top: 12px;
  }

  .mobile-risk-report .report-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-risk-report .report-meta span {
    display: block;
    width: 100%;
    word-break: break-word;
  }
}


/* 手机端风险报告可见性修复 */
.mobile-risk-report,
.mobile-risk-report * {
  box-sizing: border-box;
}

.mobile-risk-report .report-list {
  width: 100%;
  overflow: visible;
}

.mobile-risk-report .report-row {
  width: 100%;
}

.mobile-risk-report .report-row-label,
.mobile-risk-report .report-row-value {
  overflow: visible;
  text-overflow: unset;
}

@media (max-width: 768px) {
  .mobile-risk-report {
    width: 100%;
    overflow: visible;
  }

  .mobile-risk-report .report-header {
    padding: 14px 12px 12px;
  }

  .mobile-risk-report .report-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-risk-report .report-meta span {
    display: block;
    width: 100%;
    word-break: break-word;
  }

  .mobile-risk-report .report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    overflow: visible;
  }

  .mobile-risk-report .report-row {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 12px;
    border-radius: 14px;
  }

  .mobile-risk-report .report-row-label {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.5;
  }

  .mobile-risk-report .report-row-value {
    display: block;
    width: 100%;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.7;
  }

  .mobile-risk-report .report-note {
    margin-top: 12px;
  }
}


/* Desktop backend compact layout */
@media (min-width: 1024px) {
  .backend-page {
    max-width: 1080px;
    padding: 18px 14px 28px;
  }

  .simple-card,
  .login-card {
    border-radius: 22px;
    padding: 18px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .report-card,
  .qr-upload-card {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
  }

  .report-title,
  .backend-report-title {
    font-size: 18px;
  }

  .login-input {
    height: 42px;
    border-radius: 12px;
    font-size: 14px;
  }

  .primary-btn,
  .secondary-btn,
  .primary-link-btn,
  .secondary-link-btn {
    min-height: 40px;
    border-radius: 20px;
    font-size: 14px;
    padding: 0 16px;
  }

  .stats-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .stat-box {
    border-radius: 14px;
    padding: 14px 10px;
  }

  .stat-num {
    font-size: 22px;
  }

  .stat-label {
    font-size: 12px;
  }

  .table-wrap {
    margin-top: 16px;
    padding: 8px;
    border-radius: 14px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .backend-item-row {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .backend-item-label,
  .backend-item-value {
    font-size: 11px;
    line-height: 1.45;
  }
}


/* 手机端风险报告窄屏修复 */
.mobile-risk-report,
.mobile-risk-report * {
  box-sizing: border-box;
}

.mobile-risk-report .report-list {
  width: 100%;
  overflow: visible;
}

.mobile-risk-report .report-row,
.mobile-risk-report .report-note,
.mobile-risk-report .report-header {
  width: 100%;
  max-width: 100%;
}

.mobile-risk-report .report-row-label,
.mobile-risk-report .report-row-value {
  overflow: visible;
  text-overflow: unset;
}

@media (max-width: 768px) {
  .backend-page {
    max-width: 100%;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 18px;
  }

  .simple-card {
    padding: 14px 10px;
    border-radius: 18px;
  }

  .detail-grid {
    padding: 12px;
    border-radius: 14px;
  }

  .mobile-risk-report {
    margin-top: 14px;
    padding: 10px;
    border-radius: 14px;
    overflow: visible;
  }

  .mobile-risk-report .report-header {
    padding: 12px 10px 10px;
    border-radius: 12px;
  }

  .mobile-risk-report .report-title {
    font-size: 18px;
    line-height: 1.3;
  }

  .mobile-risk-report .report-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
  }

  .mobile-risk-report .report-meta span {
    display: block;
    width: 100%;
    word-break: break-word;
  }

  .mobile-risk-report .report-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    overflow: visible;
  }

  .mobile-risk-report .report-row {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 10px 10px;
    border-radius: 12px;
  }

  .mobile-risk-report .report-row-label {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.45;
  }

  .mobile-risk-report .report-row-value {
    display: block;
    width: 100%;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.6;
  }

  .mobile-risk-report .report-note {
    margin-top: 10px;
    padding: 10px 10px;
    border-radius: 12px;
  }

  .mobile-risk-report .report-note-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.6;
  }
}


.qr-upload-form {
  align-items: center;
}

.qr-type-select {
  flex: 0 0 180px;
  margin-bottom: 0;
}

.qr-file-picker {
  position: relative;
  min-width: 280px;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  min-height: 48px;
}

.qr-file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.qr-file-trigger {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
}

.qr-file-name {
  color: #5a73a2;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.qr-submit-btn {
  flex: 0 0 auto;
}

.table-link-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  font-size: 12px;
}

.backend-item-list-wide .backend-item-row {
  grid-template-columns: 180px minmax(0, 1fr);
}

@media (max-width: 768px) {
  .qr-type-select {
    flex: 1 1 auto;
  }

  .qr-file-picker {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .qr-file-trigger,
  .qr-submit-btn {
    width: 100%;
  }

  .qr-file-name {
    font-size: 13px;
  }

  .table-link-btn {
    width: 100%;
  }

  .backend-item-list-wide .backend-item-row {
    grid-template-columns: 1fr;
  }
}

.chat-config-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.backend-form-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.chat-config-form textarea.login-input {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}

/* draggable chat flow editor */
.backend-page.flow-edit-page {
  max-width: 1800px;
  width: 100%;
  padding-left: 14px;
  padding-right: 14px;
}
.flow-edit-page .simple-card { padding: 26px; }
.flow-editor-card { overflow: visible; }
.flow-edit-page-card { min-height: calc(100vh - 150px); }
.flow-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.flow-editor-wrap {
  display: grid;
  grid-template-columns: minmax(980px, 1fr) 380px;
  gap: 18px;
  align-items: stretch;
}
.flow-canvas {
  position: relative;
  height: calc(100vh - 260px);
  min-height: 760px;
  overflow: auto;
  border: 1px solid #d9e1f0;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(20,65,130,.055) 1px, transparent 1px), linear-gradient(rgba(20,65,130,.055) 1px, transparent 1px);
  background-size: 28px 28px;
}
.flow-lines { position: absolute; left: 0; top: 0; width: 3200px; height: 1600px; pointer-events: none; overflow: visible; }
.flow-line-path { fill: none; stroke: #7b8aa8; stroke-width: 2.4; }
.flow-lines marker path { fill: #7b8aa8; }
.flow-line-label { fill: #526173; font-size: 13px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.flow-nodes { position: relative; width: 3200px; min-width: 3200px; height: 1600px; min-height: 1600px; }
.flow-node {
  position: absolute;
  width: 280px;
  min-height: 118px;
  border: 1px solid #d9dfeb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 43, 82, .12);
  padding: 15px;
  cursor: move;
  user-select: none;
  z-index: 2;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.flow-node:hover { box-shadow: 0 14px 34px rgba(21, 43, 82, .18); }
.flow-node.active { border-color: #2f6fec; box-shadow: 0 14px 38px rgba(47, 111, 236, .22); }
.flow-node.is-start::before { content: '开始'; position: absolute; right: 12px; top: -12px; background: #2f6fec; color: #fff; border-radius: 999px; font-size: 12px; padding: 2px 9px; }
.flow-node-title { font-size: 16px; font-weight: 800; color: #172033; margin-bottom: 8px; }
.flow-node-field { font-size: 13px; color: #2f6fec; margin-bottom: 8px; font-weight: 700; }
.flow-node-msg { font-size: 13px; color: #677388; line-height: 1.55; white-space: pre-wrap; }
.flow-side-panel { border: 1px solid #e6e8ef; border-radius: 16px; padding: 14px; background: #fbfcff; max-height: calc(100vh - 260px); min-height: 760px; overflow: auto; }
.flow-panel-title { font-size: 16px; font-weight: 800; color: #172033; margin-bottom: 10px; }
.flow-panel-subtitle { margin-top: 14px; font-size: 14px; }
.flow-empty-hint { color: #667085; font-size: 14px; padding: 20px 4px; }
.flow-transition-list { display: flex; flex-direction: column; gap: 8px; }
.flow-transition-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid #e8ecf4; border-radius: 12px; background: #fff; }
.flow-transition-row .login-input { min-width: 0; }
.flow-small-btn { margin-top: 10px; }
.danger-link-btn { border: none; background: transparent; color: #d92d20; font-weight: 700; cursor: pointer; padding: 8px 6px; white-space: nowrap; }
@media (max-width: 1280px) {
  .flow-editor-wrap { grid-template-columns: 1fr; }
  .flow-side-panel { max-height: none; min-height: auto; }
}
@media (max-width: 900px) {
  .backend-page.flow-edit-page { padding-left: 8px; padding-right: 8px; }
  .flow-edit-page .simple-card { padding: 18px; }
  .flow-canvas { min-height: 680px; }
}

/* zgd v2026-05-20: 语聊流程编辑页全屏化，解决编辑窗口太小的问题 */
html, body {
  min-width: 0;
}
.backend-page.flow-edit-page {
  width: 100vw !important;
  max-width: none !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 8px 10px !important;
}
.flow-edit-page .simple-card {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100vh - 16px) !important;
  padding: 14px !important;
  border-radius: 18px !important;
}
.flow-edit-page .dashboard-head {
  margin-bottom: 8px !important;
}
.flow-edit-page .page-title {
  font-size: 24px !important;
}
.flow-edit-page .page-subtitle {
  margin-top: 4px !important;
  font-size: 13px !important;
}
.flow-edit-page-card {
  width: 100% !important;
  min-height: calc(100vh - 104px) !important;
  margin-top: 10px !important;
  padding: 12px !important;
  overflow: visible !important;
}
.flow-edit-page-card .report-note-text {
  margin-top: 2px !important;
  font-size: 13px !important;
}
.flow-toolbar {
  margin: 10px 0 12px !important;
  gap: 8px !important;
}
.flow-toolbar .primary-btn,
.flow-toolbar .secondary-btn,
.flow-toolbar .secondary-link-btn {
  min-height: 38px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}
.flow-edit-page .flow-editor-wrap {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 380px !important;
  gap: 12px !important;
  align-items: stretch !important;
  height: calc(100vh - 210px) !important;
  min-height: 720px !important;
}
.flow-edit-page-card .flow-canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 720px !important;
}
.flow-edit-page-card .flow-side-panel {
  height: 100% !important;
  max-height: none !important;
  min-height: 720px !important;
}
.flow-edit-page .flow-transition-row {
  grid-template-columns: 1fr 1fr 1fr auto !important;
}
.flow-edit-page-card:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 14px !important;
  border-radius: 0 !important;
  background: rgba(255,255,255,0.98) !important;
  overflow: hidden !important;
}
.flow-edit-page-card:fullscreen .flow-editor-wrap {
  height: calc(100vh - 118px) !important;
  min-height: 0 !important;
}
.flow-edit-page-card:fullscreen .flow-canvas,
.flow-edit-page-card:fullscreen .flow-side-panel {
  height: 100% !important;
  min-height: 0 !important;
}
.flow-edit-page-card:fullscreen .report-note-text {
  display: none !important;
}
@media (max-width: 1280px) {
  .flow-edit-page .flow-editor-wrap {
    grid-template-columns: minmax(0, 1fr) 340px !important;
  }
}
@media (max-width: 1100px) {
  .flow-edit-page .flow-editor-wrap {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
  .flow-edit-page-card .flow-canvas {
    height: 760px !important;
  }
  .flow-edit-page-card .flow-side-panel {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }
}


/* zgd v2026-05-21: 节点同时展示机器人语句和提示词内容 */
.flow-node-msg,
.flow-node-prompt {
  font-size: 13px;
  color: #677388;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.flow-node-prompt {
  margin-top: 6px;
  color: #8a5b12;
  background: #fff8e6;
  border: 1px solid #ffe3a6;
  border-radius: 10px;
  padding: 6px 8px;
}
.flow-node-msg span,
.flow-node-prompt span {
  display: inline-block;
  margin-right: 3px;
  font-weight: 800;
  color: #334155;
}
.flow-node-prompt span {
  color: #9a5b00;
}
.flow-node-form textarea.login-input {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

/* zgd v2026-05-21: 分支跳转改成可理解的三步配置卡片 */
.flow-branch-help {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.55;
}
.flow-branch-help-title {
  font-weight: 900;
  color: #1d4ed8;
  margin-bottom: 4px;
}
.flow-branch-help-example {
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
}
.flow-edit-page .flow-transition-list,
.flow-transition-list {
  gap: 12px !important;
}
.flow-edit-page .flow-transition-row,
.flow-transition-row {
  display: block !important;
  padding: 12px !important;
  border: 1px solid #dbeafe !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 22px rgba(30, 64, 175, .06);
}
.flow-transition-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.flow-transition-index {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}
.flow-transition-summary {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.flow-transition-field {
  display: block;
  margin-top: 10px;
}
.flow-transition-field > span {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}
.flow-transition-field .login-input {
  width: 100%;
  height: 38px;
  font-size: 13px;
}
.flow-condition-tip {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}
.flow-transition-delete {
  padding: 4px 6px !important;
}

/* zgd v2026-05-21: 后台 dashboard 流程图只读预览压缩高度，避免页面过高不协调 */
.flow-readonly-card {
  overflow: hidden !important;
}
.flow-readonly-card .flow-config-head {
  align-items: center;
}
.flow-readonly-preview-note {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}
.flow-readonly-wrap {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  gap: 0 !important;
}
.flow-readonly-canvas {
  height: 380px !important;
  min-height: 380px !important;
  max-height: 380px !important;
  overflow: auto !important;
  border-radius: 16px !important;
}
.flow-readonly-canvas .flow-lines {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  pointer-events: none !important;
  overflow: visible !important;
}
.flow-readonly-canvas .flow-nodes {
  position: relative !important;
  min-width: 1100px !important;
  min-height: 340px !important;
}
.flow-node-readonly {
  width: 220px !important;
  min-height: 98px !important;
  padding: 10px 11px !important;
  cursor: default !important;
  box-shadow: 0 6px 18px rgba(21, 43, 82, .10) !important;
}
.flow-node-readonly .flow-node-title {
  font-size: 13px !important;
  margin-bottom: 4px !important;
}
.flow-node-readonly .flow-node-field {
  font-size: 11px !important;
  margin-bottom: 5px !important;
}
.flow-node-readonly .flow-node-msg,
.flow-node-readonly .flow-node-prompt {
  font-size: 11px !important;
  line-height: 1.35 !important;
}
.flow-node-readonly .flow-node-prompt {
  margin-top: 4px !important;
  padding: 4px 6px !important;
  border-radius: 8px !important;
}
.flow-readonly-canvas .flow-line-path {
  stroke-width: 2 !important;
}
.flow-readonly-canvas .flow-line-label {
  font-size: 11px !important;
  stroke-width: 4px !important;
}

/* zgd v2026-05-21: 编辑页重新排版改为按分支层级排，不再按数组网格乱排 */
.flow-edit-page .flow-line-label {
  font-size: 12px !important;
}

/* 人工聊天后台 */
.backend-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.agent-account-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.agent-account-card {
  border: 1px solid #d8e6ff;
  border-radius: 16px;
  background: #f7fbff;
  padding: 14px;
}
.agent-account-name {
  font-weight: 800;
  color: #1d4f9f;
  margin-bottom: 8px;
}
.human-inbox-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.human-inbox-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dce8ff;
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.human-inbox-item:hover {
  box-shadow: 0 10px 24px rgba(51, 112, 255, .12);
}
.human-inbox-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e2b4a;
}
.human-inbox-meta,
.human-inbox-last {
  color: #687999;
  font-size: 13px;
  margin-top: 5px;
}
.human-chat-backend-card {
  max-width: 1100px;
  margin: 0 auto;
}
.human-chat-customer-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #eef6ff;
  color: #24456f;
  font-size: 14px;
  margin: 14px 0;
}
.human-chat-backend-thread {
  height: 560px;
  overflow-y: auto;
  background: #f5f7fb;
  border-radius: 22px;
  border: 1px solid #e4eaf5;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.backend-chat-msg {
  max-width: 72%;
}
.backend-chat-msg-customer {
  align-self: flex-start;
}
.backend-chat-msg-agent {
  align-self: flex-end;
  text-align: right;
}
.backend-chat-msg-meta {
  font-size: 12px;
  color: #8795ad;
  margin-bottom: 4px;
}
.backend-chat-msg-bubble {
  display: inline-block;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e9f5;
  text-align: left;
  line-height: 1.7;
  white-space: pre-wrap;
}
.backend-chat-msg-agent .backend-chat-msg-bubble {
  background: #3378ff;
  color: #fff;
  border-color: #3378ff;
}
.backend-human-send-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.backend-human-send-form .login-input {
  flex: 1;
}
@media (max-width: 900px) {
  .agent-account-grid,
  .human-chat-customer-card {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .backend-chat-msg { max-width: 88%; }
}

/* 客服账号配置与人工客服增强 */
.agent-config-form,
.agent-config-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr .7fr auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.agent-config-list { display: grid; gap: 12px; margin-top: 12px; }
.agent-config-row {
  padding: 14px;
  border: 1px solid #dce8ff;
  border-radius: 18px;
  background: #fff;
}
.agent-config-field label {
  display: block;
  font-size: 12px;
  color: #6c7e9d;
  margin-bottom: 5px;
  font-weight: 700;
}
.agent-switch { display: inline-flex; align-items: center; gap: 6px; color: #355075; font-weight: 700; white-space: nowrap; }
.agent-config-actions { display: flex; gap: 8px; align-items: center; }
.danger-link-btn { border: 0; background: transparent; color: #ef4444; font-weight: 800; cursor: pointer; }
.error-notice { color: #b91c1c; background: #fff1f2; border-color: #fecdd3; }
.success-notice { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.human-chat-status {
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}
.human-chat-status.is-bad { background: #fff7ed; color: #c2410c; }
.human-bigdata-panel {
  margin: 12px 0;
  border: 1px solid #dce8ff;
  border-radius: 18px;
  background: #fbfdff;
  padding: 12px 14px;
}
.human-bigdata-panel summary { cursor: pointer; font-weight: 900; color: #1d4f9f; }
.human-bigdata-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: #355075;
  font-size: 13px;
}
.human-bigdata-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}
.human-bigdata-item {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e3ecfb;
  padding: 9px 10px;
  font-size: 13px;
}
.human-bigdata-item strong { display: block; color: #60708e; margin-bottom: 4px; }
.human-bigdata-item span { color: #1f2d4a; }
@media (max-width: 900px) {
  .agent-config-form,
  .agent-config-row { grid-template-columns: 1fr; }
  .human-bigdata-grid { grid-template-columns: 1fr; }
}

/* zgd manual chat permissions + unread list */
.unread-total-badge,
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.human-inbox-item.has-unread {
  border-color: rgba(239, 68, 68, 0.45);
  background: #fff8f8;
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.08);
}
.human-inbox-item.has-unread .human-inbox-title {
  color: #b91c1c;
  font-weight: 800;
}
.readonly-tip {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}

/* zgd human chat image support */
.backend-image-upload-btn {
  cursor: pointer;
  white-space: nowrap;
}
.human-chat-image {
  display: block;
  max-width: 280px;
  max-height: 280px;
  border-radius: 12px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.human-chat-caption {
  margin-top: 6px;
  white-space: pre-wrap;
}
.human-image-bubble:has(.human-chat-image) {
  padding: 8px;
}
.backend-human-send-form {
  align-items: center;
}
@media (max-width: 768px) {
  .human-chat-image {
    max-width: 62vw;
    max-height: 220px;
  }
}


/* zgd: backend客服发送图片前的预览，确保选图后在输入框区域能看到图片内容 */
.backend-selected-image-preview {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
}
.backend-selected-image-preview[hidden] {
  display: none !important;
}
.backend-selected-image-preview img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
}
.backend-selected-image-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #1e3a8a;
}
.backend-selected-image-info strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backend-selected-image-info span {
  font-size: 12px;
  color: #64748b;
}
.backend-selected-image-clear {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  font-weight: 700;
}
.backend-selected-image-clear:hover {
  background: #fecaca;
}
.human-wechat-send-form .primary-btn:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

/* zgd wechat-like backend human chat layout */
.human-wechat-page {
  max-width: 100vw;
  padding: 18px;
}
.human-wechat-card {
  max-width: 1560px;
  margin: 0 auto;
  min-height: calc(100vh - 36px);
}
.human-wechat-head {
  margin-bottom: 14px;
}
.human-wechat-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 170px);
  min-height: 650px;
  border: 1px solid #dbe7f7;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}
.human-wechat-sidebar {
  min-width: 0;
  background: #f6f8fb;
  border-right: 1px solid #dbe7f7;
  display: flex;
  flex-direction: column;
}
.human-wechat-sidebar-title {
  height: 58px;
  flex: 0 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 900;
  color: #1f2d4a;
  border-bottom: 1px solid #e4ebf5;
  background: #fff;
}
.human-wechat-list {
  overflow-y: auto;
  flex: 1;
}
.human-wechat-session {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  min-height: 78px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #e9eef6;
  background: #f9fbff;
}
.human-wechat-session:hover { background: #eef5ff; }
.human-wechat-session.is-active {
  background: #e8f1ff;
  border-left: 4px solid #3378ff;
  padding-left: 10px;
}
.human-wechat-session.has-unread {
  background: #fff8f8;
}
.human-wechat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3378ff, #73a8ff);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(51, 120, 255, .18);
}
.human-wechat-session-main { min-width: 0; }
.human-wechat-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #1e2b4a;
}
.human-wechat-session-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.human-wechat-session-phone,
.human-wechat-session-last {
  color: #74829a;
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.human-wechat-empty-list {
  padding: 24px 16px;
  color: #8795ad;
  text-align: center;
}
.human-wechat-empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  background: #fbfdff;
  padding: 28px;
}
.human-wechat-empty-icon { font-size: 56px; margin-bottom: 14px; }
.human-wechat-empty-panel h2 {
  margin: 0 0 8px;
  color: #1f2d4a;
}
.human-wechat-chat-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fb;
}
.human-wechat-chat-header {
  min-height: 58px;
  flex: 0 0 auto;
  padding: 10px 16px;
  border-bottom: 1px solid #e4ebf5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}
.human-wechat-chat-name {
  font-size: 17px;
  color: #1f2d4a;
  font-weight: 900;
}
.human-wechat-chat-sub {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}
.human-wechat-chat-header .human-chat-status {
  margin: 0;
  white-space: nowrap;
}
.human-wechat-customer-detail {
  flex: 0 0 auto;
  margin: 10px 14px 0;
  border: 1px solid #dce8ff;
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
}
.human-wechat-customer-detail summary {
  cursor: pointer;
  font-weight: 900;
  color: #1d4f9f;
}
.human-wechat-customer-grid {
  margin: 10px 0 0;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}
.human-wechat-bigdata-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}
.human-wechat-thread {
  flex: 1;
  min-height: 0;
  height: auto;
  margin: 12px 14px 0;
  border-radius: 18px;
  border: 1px solid #e1e8f3;
}
.human-wechat-send-form {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #e4ebf5;
}
.human-wechat-send-form .login-input {
  height: 42px;
  border-radius: 12px;
}
@media (max-width: 1000px) {
  .human-wechat-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .human-wechat-customer-grid,
  .human-wechat-bigdata-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}
@media (max-width: 760px) {
  .human-wechat-page { padding: 8px; }
  .human-wechat-card { min-height: calc(100vh - 16px); }
  .human-wechat-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .human-wechat-sidebar {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid #dbe7f7;
  }
  .human-wechat-empty-panel { min-height: 340px; }
  .human-wechat-chat-panel { min-height: 680px; }
  .human-wechat-chat-header { align-items: flex-start; flex-direction: column; }
  .human-wechat-thread { min-height: 430px; }
  .human-wechat-customer-grid,
  .human-wechat-bigdata-grid { grid-template-columns: 1fr; }
  .human-wechat-send-form { flex-wrap: wrap; }
  .human-wechat-send-form .login-input { flex-basis: 100%; }
}

/* zgd fix: compact backend human-chat text bubbles and avoid blank-line stretched boxes */
.human-wechat-thread .backend-chat-msg {
  width: fit-content;
  max-width: min(72%, 760px);
}
.human-wechat-thread .backend-chat-msg-bubble {
  display: inline-block;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 10px 14px;
  line-height: 1.55;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.human-wechat-thread .human-chat-caption {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}
.human-wechat-thread .human-image-bubble:has(.human-chat-image) .human-chat-caption {
  margin-top: 6px;
}
.agent-password-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

/* zgd: upstream/downstream traffic channel configuration */
.traffic-config-card { overflow: visible; }
.traffic-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.traffic-form-grid label,
.traffic-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #33506f;
  font-weight: 700;
  font-size: 13px;
}
.traffic-checkbox {
  flex-direction: row !important;
  align-items: center;
  min-height: 42px;
}
.traffic-table-wrap { overflow-x: auto; }
.traffic-table th,
.traffic-table td { vertical-align: top; }
.traffic-url-cell {
  min-width: 320px;
  word-break: break-all;
  line-height: 1.6;
}
.traffic-entry-url {
  margin-top: 4px;
  color: #0b63ce;
}
.traffic-actions-cell { min-width: 180px; }
.traffic-inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe7f7;
  border-radius: 14px;
  background: #f8fbff;
}
.traffic-small-action { margin-top: 8px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}
.status-ok { background: #e6f8ef; color: #119251; }
.status-muted { background: #eef2f7; color: #64748b; }
.delete-link-btn {
  border: 0;
  background: transparent;
  color: #e11d48;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
@media (max-width: 900px) {
  .traffic-form-grid { grid-template-columns: 1fr; }
}


/* zgd 2026-05-26 v8：图片预览不能把输入框/发送按钮挤出可视区 */
.human-wechat-send-form,
.backend-human-send-form.human-wechat-send-form {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
}
.human-wechat-send-form .backend-selected-image-preview {
  flex: 1 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 2px !important;
}
.human-wechat-send-form .login-input {
  flex: 1 1 260px !important;
  min-width: 180px !important;
}
.human-wechat-send-form .backend-image-upload-btn,
.human-wechat-send-form .primary-btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 760px) {
  .human-wechat-send-form .backend-image-upload-btn,
  .human-wechat-send-form .primary-btn {
    flex: 1 1 calc(50% - 6px) !important;
  }
}

/* zgd 2026-05-26 v7：取消人工聊天左侧会话跳转文字提示 */
.human-wechat-session.is-navigating,
.human-wechat-session.is-navigating::after {
  content: none !important;
}

/* ===== zgd 2026-05-26 v3：后台人工聊天纯文本气泡紧凑显示 ===== */
.human-wechat-thread .human-text-bubble,
.human-wechat-thread .backend-chat-msg-bubble.human-text-bubble {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  max-width: min(74%, 520px) !important;
  min-width: 48px !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  box-sizing: border-box !important;
}
.human-wechat-thread .human-text-bubble .human-chat-caption,
.human-wechat-thread .human-chat-caption {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  line-height: 1.45 !important;
  white-space: normal !important;
}

/* ===== zgd 2026-05-26 v4：多客户人工聊天未读提醒 ===== */
.human-wechat-session.has-new-reply {
  background: #fff1f2 !important;
  border-left: 4px solid #ef4444;
  padding-left: 10px;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .16);
  animation: human-chat-new-reply-pulse 1.4s ease-in-out infinite;
}
.human-wechat-session.has-new-reply .human-wechat-session-row strong {
  color: #b91c1c;
  font-weight: 900;
}
.human-wechat-session.has-new-reply .human-wechat-session-last {
  color: #b91c1c;
  font-weight: 800;
}
.human-wechat-session.has-new-reply .human-wechat-session-row strong::after {
  content: '未回复';
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  line-height: 1.4;
  vertical-align: middle;
}
@keyframes human-chat-new-reply-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .16), 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .24), 0 8px 22px rgba(239, 68, 68, .16); }
}

/* ===== zgd 2026-05-26 v10：后台人工聊天列表滚动、新消息置顶与点击回到底部 ===== */
.human-wechat-layout,
.human-wechat-sidebar,
.human-wechat-chat-panel {
  min-height: 0 !important;
}
.human-wechat-sidebar {
  overflow: hidden !important;
  max-height: 100% !important;
}
.human-wechat-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: calc(100vh - 240px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
}
.human-wechat-session.has-new-reply,
.human-wechat-session.has-unread {
  position: relative;
  z-index: 2;
}
.human-wechat-thread {
  scroll-behavior: smooth;
}
.human-wechat-chat-panel {
  cursor: default;
}
@media (max-width: 760px) {
  .human-wechat-list {
    max-height: 220px !important;
  }
}



/* zgd 2026-05-26 v14: traffic page high-contrast theme; fix white background + white text */
body.backend-page.traffic-page {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 36px;
  background: linear-gradient(180deg, #eaf4ff 0%, #f7fbff 46%, #ffffff 100%);
  color: #17315f;
}
.traffic-page .backend-container {
  width: min(1480px, 100%);
  margin: 0 auto;
}
.traffic-page .backend-card {
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, #4ea3ff 0%, #7dbdf8 18%, #edf6ff 42%, #ffffff 100%);
  box-shadow: 0 10px 30px rgba(29, 78, 216, 0.12);
  color: #17315f;
}
.traffic-page .page-title {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}
.traffic-page .page-subtitle {
  color: rgba(255,255,255,0.96) !important;
}
.traffic-page .report-card,
.traffic-page .table-wrap,
.traffic-page .traffic-inline-form,
.traffic-page .notice-box,
.traffic-page .error-box {
  background: rgba(255,255,255,0.96);
  color: #17315f;
}
.traffic-page .backend-report-title,
.traffic-page .report-note-text,
.traffic-page .traffic-region-help-text,
.traffic-page .traffic-form-grid label,
.traffic-page .traffic-inline-form label,
.traffic-page .traffic-checkbox,
.traffic-page .traffic-table td,
.traffic-page .traffic-table th,
.traffic-page .mono {
  color: #17315f;
}
.traffic-page .traffic-table th {
  background: #eaf3ff;
  color: #123a78;
}
.traffic-page .traffic-table td {
  background: #ffffff;
}
.traffic-page .login-input {
  background: #ffffff;
  color: #17315f;
  border: 1px solid #d6e5f8;
}
.traffic-page .login-input::placeholder {
  color: #8aa0bc;
}
.traffic-page .traffic-region-help-card {
  border: 1px solid #cfe2ff;
}
.traffic-page .traffic-region-help-text {
  margin-top: 10px;
  line-height: 1.8;
}

/* zgd v16: traffic counter helper label */
.traffic-small-muted {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

/* zgd v17: 设置上游入口时隐藏下游配置字段，避免上游配置页混入下游信息 */
.traffic-page .traffic-hidden {
  display: none !important;
}
.traffic-page .traffic-form-note-wrap {
  min-height: 24px;
}
.traffic-page .traffic-upstream-note,
.traffic-page .traffic-downstream-note {
  line-height: 1.7;
}

/* zgd v18: traffic channel list search + clean edit panel + dual upstream protocols */
.traffic-page .traffic-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.traffic-page .traffic-search-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: min(560px, 100%);
}
.traffic-page .traffic-search-bar .login-input {
  width: min(360px, 100%);
}
.traffic-page .traffic-edit-card {
  border: 2px solid #93c5fd;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.12);
}
.traffic-page .traffic-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.traffic-page .traffic-edit-form {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}
.traffic-page .traffic-action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.traffic-page .traffic-action-stack .traffic-small-action {
  margin-top: 0;
}
.traffic-page .traffic-actions-cell {
  min-width: 120px;
}
.traffic-page .traffic-url-cell {
  min-width: 420px;
  max-width: 620px;
}
.traffic-page .traffic-protocol-line {
  margin: 2px 0;
  word-break: break-all;
}
.traffic-page .traffic-protocol-line strong {
  display: inline-block;
  min-width: 58px;
  color: #123a78;
}
.traffic-page .traffic-table-wrap {
  max-height: none;
  overflow: auto;
}
.traffic-page .traffic-table {
  min-width: 1180px;
}
@media (max-width: 900px) {
  .traffic-page .traffic-list-head,
  .traffic-page .traffic-edit-head {
    flex-direction: column;
    align-items: stretch;
  }
  .traffic-page .traffic-search-bar {
    justify-content: flex-start;
    min-width: 0;
  }
  .traffic-page .traffic-form-grid,
  .traffic-page .traffic-edit-form {
    grid-template-columns: 1fr;
  }
}

/* zgd v19: 地区关键词支持全国城市库搜索和多选 */
.traffic-page .traffic-region-field {
  grid-column: span 2;
  min-width: 0;
}
.traffic-page .traffic-region-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.traffic-page .traffic-region-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 7px;
  border: 1px solid #d6e5f8;
  border-radius: 12px;
  background: #f8fbff;
}
.traffic-page .traffic-region-empty {
  color: #7a8fa8;
  font-size: 12px;
  line-height: 20px;
}
.traffic-page .traffic-region-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0efff;
  color: #123a78;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.4;
}
.traffic-page .traffic-region-chip.is-exclude {
  background: #fee2e2;
  color: #b91c1c;
}
.traffic-page .traffic-region-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  color: inherit;
  cursor: pointer;
  font-weight: 900;
  line-height: 18px;
}
.traffic-page .traffic-region-search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.traffic-page .traffic-region-search-input {
  flex: 1 1 auto;
  min-width: 0;
}
.traffic-page .traffic-region-add-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.traffic-page .traffic-region-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(30, 64, 175, 0.18);
}
.traffic-page .traffic-region-suggestions.is-open {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
}
.traffic-page .traffic-region-suggestion {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  color: #17315f;
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}
.traffic-page .traffic-region-suggestion:hover {
  background: #eaf3ff;
  border-color: #93c5fd;
}
.traffic-page .traffic-region-suggestion:disabled {
  cursor: not-allowed;
  opacity: .46;
}
.traffic-page .traffic-region-suggestion.is-custom {
  grid-column: 1 / -1;
  color: #0b63ce;
}
.traffic-page .traffic-region-tip {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
@media (max-width: 900px) {
  .traffic-page .traffic-region-field { grid-column: span 1; }
  .traffic-page .traffic-region-search-row { flex-direction: column; }
}

/* zgd v20: 上下游流程图、关系配置、统计表 */
.traffic-page .traffic-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.traffic-page .traffic-flow-card,
.traffic-page .traffic-stats-filter-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  box-shadow: 0 12px 34px rgba(30, 64, 175, .08);
}
.traffic-page .traffic-flow-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: clamp(48px, 12vw, 180px);
  min-height: 260px;
  padding: 18px;
  border: 1px solid #d9e7fb;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
  overflow-x: auto;
}
.traffic-page .traffic-flow-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.traffic-page .traffic-flow-path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .82;
}
.traffic-page .traffic-flow-path.is-default {
  stroke: #94a3b8;
  stroke-dasharray: 7 6;
  opacity: .68;
}
.traffic-page .traffic-flow-column {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
}
.traffic-page .traffic-flow-title {
  color: #17315f;
  font-size: 15px;
  font-weight: 900;
  padding: 0 4px;
}
.traffic-page .traffic-flow-node {
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(30, 64, 175, .10);
  color: #172554;
}
.traffic-page .traffic-flow-node.is-disabled {
  opacity: .55;
  filter: grayscale(.3);
}
.traffic-page .traffic-flow-node-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
  color: #0f172a;
}
.traffic-page .traffic-flow-node-code,
.traffic-page .traffic-flow-node-stat,
.traffic-page .traffic-flow-node-note {
  margin-top: 5px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}
.traffic-page .traffic-flow-node-code {
  font-family: Consolas, Monaco, monospace;
  color: #1d4ed8;
  font-weight: 800;
}
.traffic-page .traffic-flow-node-note {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}
.traffic-page .flow-empty {
  background: rgba(255,255,255,.8);
  border-radius: 14px;
  padding: 24px;
}
.traffic-page .traffic-link-picker {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed #93c5fd;
  border-radius: 14px;
  background: #f8fbff;
}
.traffic-page .traffic-link-picker-title {
  color: #17315f;
  font-weight: 900;
  margin-bottom: 6px;
}
.traffic-page .traffic-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.traffic-page .traffic-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fff;
  color: #17315f;
  font-size: 13px;
  font-weight: 700;
}
.traffic-page .traffic-checkbox-item input {
  flex: 0 0 auto;
}
.traffic-page .traffic-link-state {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
.traffic-page .traffic-link-state.is-all {
  background: #f1f5f9;
  color: #475569;
}
.traffic-page .traffic-region-chips,
.traffic-page .traffic-region-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 7px;
  border: 1px solid #d6e5f8;
  border-radius: 12px;
  background: #f8fbff;
}
.traffic-page .traffic-stats-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(140px, .8fr) auto;
  gap: 12px;
  align-items: end;
}
.traffic-page .traffic-stats-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.traffic-page .traffic-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.traffic-page .traffic-stat-card {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 64, 175, .08);
}
.traffic-page .traffic-stat-card span {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.traffic-page .traffic-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
}
@media (max-width: 980px) {
  .traffic-page .traffic-flow-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .traffic-page .traffic-flow-lines {
    display: none;
  }
  .traffic-page .traffic-stats-filter-form,
  .traffic-page .traffic-stat-cards {
    grid-template-columns: 1fr;
  }
  .traffic-page .traffic-section-head {
    flex-direction: column;
  }
}

/* zgd v21: 流程图节点支持直接编辑/新增，新增/编辑卡片定位高亮 */
.traffic-page .traffic-flow-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.traffic-page .traffic-flow-node-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbeafe;
}
.traffic-page .traffic-flow-node-actions .secondary-link-btn,
.traffic-page .traffic-flow-node-actions .table-link-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font-size: 12px;
}
.traffic-page .traffic-card-focus {
  animation: trafficCardFocusPulse 1.8s ease;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 16px 42px rgba(30, 64, 175, .18) !important;
}
@keyframes trafficCardFocusPulse {
  0% { transform: translateY(-2px); }
  35% { transform: translateY(0); }
  100% { transform: translateY(0); }
}
@media (max-width: 768px) {
  .traffic-page .traffic-flow-actions,
  .traffic-page .traffic-flow-node-actions {
    justify-content: flex-start;
  }
  .traffic-page .traffic-flow-actions .primary-link-btn,
  .traffic-page .traffic-flow-actions .secondary-link-btn,
  .traffic-page .traffic-flow-actions button {
    flex: 1 1 120px;
  }
}


/* zgd v22: 流程图顶部只保留编辑入口；下方为统一数据统计表 */
.traffic-page .traffic-editor-open-btn {
  min-width: 112px;
  justify-content: center;
}
.traffic-page .traffic-summary-card {
  border: 1px solid #bfdbfe;
  box-shadow: 0 14px 36px rgba(30, 64, 175, .10);
}
.traffic-page .traffic-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.traffic-page .traffic-editor-intro-card {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}
.traffic-page .traffic-inline-stat-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.traffic-page .traffic-summary-table {
  min-width: 1080px;
}
.traffic-page .traffic-search-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: min(520px, 100%);
}
.traffic-page .traffic-search-form .login-input {
  width: min(340px, 100%);
}
@media (max-width: 1180px) {
  .traffic-page .traffic-inline-stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .traffic-page .traffic-inline-stat-cards {
    grid-template-columns: 1fr;
  }
  .traffic-page .traffic-search-form {
    justify-content: flex-start;
    min-width: 0;
  }
}

/* zgd v23: 操作入口统一收敛到上下游流程图 */
.traffic-page .traffic-editor-empty-card {
  border: 1px dashed #bfdbfe;
  background: #f8fbff;
}
.traffic-page.traffic-edit-mode .traffic-flow-card {
  border-color: #60a5fa;
  box-shadow: 0 16px 42px rgba(37, 99, 235, .16);
}
.traffic-page .traffic-flow-node-actions .traffic-small-action {
  margin-top: 0;
}
.traffic-page .traffic-flow-node-actions .delete-link-btn.table-link-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #fecdd3;
  border-radius: 15px;
  background: #fff1f2;
  color: #e11d48;
}
.traffic-page .traffic-flow-node-actions .delete-link-btn.table-link-btn:hover {
  background: #ffe4e6;
}

/* zgd v24: 上下游流程图改为思维导图式节点添加 */
.traffic-page .traffic-flow-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
.traffic-page .traffic-mind-edit-tip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #bfdbfe;
}
.traffic-page .traffic-mind-plus,
.traffic-page .traffic-mind-edit,
.traffic-page .traffic-mind-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.traffic-page .traffic-mind-plus {
  border: 1px solid #60a5fa;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .20);
}
.traffic-page .traffic-mind-plus:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .28);
}
.traffic-page .traffic-mind-edit {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8 !important;
}
.traffic-page .traffic-mind-delete {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #e11d48 !important;
}
.traffic-page .traffic-mind-delete-form {
  display: inline-flex;
  margin: 0 !important;
}
.traffic-page .traffic-mind-delete-form button {
  font-family: inherit;
}
.traffic-page .traffic-flow-node {
  position: relative;
  overflow: visible;
}
.traffic-page .traffic-mind-node-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dbeafe;
}
.traffic-page .traffic-mind-node-actions .traffic-mind-plus::before {
  content: '';
  position: absolute;
}
.traffic-page.traffic-edit-mode .traffic-flow-node::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 14px;
  height: 2px;
  background: #60a5fa;
  opacity: .5;
}
.traffic-page.traffic-edit-mode .traffic-flow-upstreams .traffic-flow-node::after {
  right: -14px;
}
.traffic-page.traffic-edit-mode .traffic-flow-downstreams .traffic-flow-node::after {
  left: -14px;
}
.traffic-page .flow-empty .traffic-mind-plus {
  margin-top: 12px;
}
@media (max-width: 980px) {
  .traffic-page.traffic-edit-mode .traffic-flow-node::after {
    display: none;
  }
  .traffic-page .traffic-flow-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* zgd v25: 上下游编辑页按参考图改成多上游思维导图分支 */
.traffic-page .traffic-mindmap-wrap {
  display: block;
  min-height: 360px;
  padding: 18px;
  overflow-x: auto;
  overflow-y: visible;
}
.traffic-page .traffic-mindmap-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  min-width: 960px;
}
.traffic-page .traffic-mindmap-board {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 960px;
}
.traffic-page .traffic-mindmap-row {
  position: relative;
  display: grid;
  grid-template-columns: 310px minmax(560px, 1fr);
  gap: 96px;
  align-items: center;
  min-height: 190px;
  padding: 18px;
  border: 1px solid rgba(147, 197, 253, .45);
  border-radius: 22px;
  background: rgba(255,255,255,.54);
}
.traffic-page .traffic-map-upstream {
  min-height: 166px;
  border-color: #111827;
  background: linear-gradient(145deg, #020617, #0f1e46 58%, #172554);
  color: #fff;
  box-shadow: 0 20px 40px rgba(2, 6, 23, .18);
}
.traffic-page .traffic-map-upstream .traffic-flow-node-title {
  color: #fff;
  font-size: 20px;
  letter-spacing: .03em;
}
.traffic-page .traffic-map-upstream .traffic-flow-node-code,
.traffic-page .traffic-map-upstream .traffic-flow-node-stat,
.traffic-page .traffic-map-upstream .traffic-map-link-lines {
  color: rgba(255,255,255,.86);
}
.traffic-page .traffic-map-upstream .traffic-flow-node-note {
  background: rgba(59,130,246,.18);
  color: #dbeafe;
  border: 1px solid rgba(147,197,253,.4);
}
.traffic-page .traffic-map-link-lines {
  margin-top: 7px;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
}
.traffic-page .traffic-map-link-lines .mono {
  font-size: 11px;
}

/* zgd v29: 仅调整上下游流程图中上游模块链接 mono 文本颜色 */
.traffic-page .traffic-map-upstream .traffic-map-link-lines .mono {
  color: #ffffff !important;
}
.traffic-page .traffic-map-branches {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.traffic-page .traffic-map-branch {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(230px, 360px);
  gap: 18px;
  align-items: center;
  min-height: 112px;
}
.traffic-page .traffic-branch-condition {
  position: relative;
  z-index: 3;
  justify-self: start;
  max-width: 190px;
  padding: 9px 10px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fff7ed;
  color: #991b1b;
  box-shadow: 0 10px 24px rgba(248, 113, 113, .12);
  font-size: 12px;
  line-height: 1.45;
}
.traffic-page .traffic-map-branch.is-default .traffic-branch-condition {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.traffic-page .traffic-branch-condition strong,
.traffic-page .traffic-branch-condition span,
.traffic-page .traffic-branch-condition em {
  display: block;
}
.traffic-page .traffic-branch-condition strong {
  font-size: 13px;
  font-weight: 900;
}
.traffic-page .traffic-branch-condition span {
  margin-top: 3px;
  color: #334155;
  word-break: break-word;
}
.traffic-page .traffic-branch-condition em {
  width: fit-content;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: #1d4ed8;
  font-style: normal;
  font-weight: 900;
}
.traffic-page .traffic-map-downstream {
  border-width: 0;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #fb923c);
  box-shadow: 0 16px 34px rgba(249, 115, 22, .20);
}
.traffic-page .traffic-map-branch:nth-child(3n+1) .traffic-map-downstream {
  background: linear-gradient(135deg, #ef4444, #fb7185);
  box-shadow: 0 16px 34px rgba(239, 68, 68, .20);
}
.traffic-page .traffic-map-branch:nth-child(3n+2) .traffic-map-downstream {
  background: linear-gradient(135deg, #f97316, #f59e0b);
  box-shadow: 0 16px 34px rgba(249, 115, 22, .20);
}
.traffic-page .traffic-map-branch:nth-child(3n) .traffic-map-downstream {
  background: linear-gradient(135deg, #eab308, #facc15);
  box-shadow: 0 16px 34px rgba(234, 179, 8, .22);
}
.traffic-page .traffic-map-downstream .traffic-flow-node-title,
.traffic-page .traffic-map-downstream .traffic-flow-node-code,
.traffic-page .traffic-map-downstream .traffic-flow-node-stat,
.traffic-page .traffic-map-downstream .traffic-map-link-lines {
  color: rgba(255,255,255,.95);
}
.traffic-page .traffic-map-downstream .traffic-flow-node-title {
  font-size: 17px;
}
.traffic-page .traffic-map-downstream .traffic-flow-node-note {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
}
.traffic-page .traffic-flow-path {
  stroke: #ef4444;
  stroke-width: 3;
  opacity: .78;
}
.traffic-page .traffic-flow-path.is-default {
  stroke: #eab308;
  stroke-width: 3;
  stroke-dasharray: 8 7;
  opacity: .72;
}
.traffic-page .traffic-map-branch.is-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 90px;
}
.traffic-page .traffic-mindmap-empty {
  min-width: 960px;
}
.traffic-page.traffic-edit-mode .traffic-map-upstream,
.traffic-page.traffic-edit-mode .traffic-map-downstream {
  outline: 2px dashed rgba(37, 99, 235, .22);
  outline-offset: 4px;
}
.traffic-page.traffic-edit-mode .traffic-flow-node::after {
  display: none;
}
@media (max-width: 1100px) {
  .traffic-page .traffic-mindmap-wrap {
    overflow-x: auto;
  }
  .traffic-page .traffic-mindmap-toolbar,
  .traffic-page .traffic-mindmap-board,
  .traffic-page .traffic-mindmap-empty {
    min-width: 920px;
  }
  .traffic-page .traffic-mindmap-row {
    grid-template-columns: 280px minmax(560px, 1fr);
    gap: 78px;
  }
}

/* zgd1 fix: make current backend customer-service identity explicit. */
.backend-current-agent-text {
  font-weight: 800;
  color: #111827;
}
.backend-current-agent-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .backend-current-agent-badge {
    width: 100%;
    justify-content: center;
  }
}

/* zgd1 v35: polished PV/UV traffic statistics page */
.traffic-stats-page {
  max-width: 1440px;
  color: #183b7a;
}
.traffic-stats-page .traffic-stats-container {
  width: 100%;
}
.traffic-stats-page .traffic-stats-shell {
  background: linear-gradient(180deg, #5ca8ff 0%, #8fc7ff 18%, #edf6ff 48%, #f7fbff 100%);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(13, 99, 241, 0.12);
}
.traffic-stats-page .traffic-stats-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 4px 12px;
}
.traffic-stats-page .traffic-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.traffic-stats-page .traffic-alert {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}
.traffic-stats-page .traffic-alert.success {
  color: #0f6b45;
  background: rgba(220, 255, 236, 0.94);
  border: 1px solid rgba(15, 107, 69, 0.12);
}
.traffic-stats-page .traffic-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
}
.traffic-stats-page .traffic-section-title {
  color: #153b7b;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
}
.traffic-stats-page .traffic-stats-filter-card,
.traffic-stats-page .traffic-demo-card,
.traffic-stats-page .polished-table-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(76, 128, 204, 0.12);
  box-shadow: 0 10px 28px rgba(29, 77, 149, 0.08);
}
.traffic-stats-page .traffic-stats-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, .8fr) minmax(160px, .8fr) minmax(160px, .8fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.traffic-stats-page .traffic-stats-filter-form label {
  color: #42659d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}
.traffic-stats-page .traffic-stats-filter-form .login-input {
  height: 42px;
  margin-top: 6px;
  margin-bottom: 0;
  border: 1px solid rgba(39,80,171,0.12);
  background: #f8fbff;
  color: #163d81;
}
.traffic-stats-page .traffic-stats-filter-actions,
.traffic-stats-page .traffic-demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.traffic-stats-page .traffic-demo-card .report-note-text {
  margin-top: 10px;
}
.traffic-stats-page .traffic-demo-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #5a73a2;
  background: #f4f8ff;
  font-size: 12px;
  line-height: 1.6;
}
.traffic-stats-page .traffic-kpi-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.traffic-stats-page .traffic-kpi-group {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(76, 128, 204, 0.12);
  box-shadow: 0 10px 28px rgba(29, 77, 149, 0.06);
}
.traffic-stats-page .traffic-kpi-title {
  color: #315a9c;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}
.traffic-stats-page .traffic-stat-cards.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.traffic-stats-page .traffic-stat-card {
  min-height: 96px;
  padding: 15px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  border: 1px solid rgba(39,80,171,0.08);
  box-shadow: none;
  text-align: left;
}
.traffic-stats-page .traffic-stat-card span {
  display: block;
  color: #6780aa;
  font-size: 13px;
  font-weight: 800;
}
.traffic-stats-page .traffic-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #0d63f1;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.traffic-stats-page .traffic-stat-card.pv strong { color: #0d63f1; }
.traffic-stats-page .traffic-stat-card.uv strong { color: #12a36b; }
.traffic-stats-page .traffic-stat-card.jump strong { color: #aa63e8; }
.traffic-stats-page .traffic-table-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.traffic-stats-page .traffic-table-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0d63f1;
  background: #eef6ff;
  border: 1px solid rgba(13,99,241,0.12);
  font-size: 12px;
  font-weight: 800;
}
.traffic-stats-page .traffic-table-badge.total {
  color: #12a36b;
  background: #ecfff6;
  border-color: rgba(18,163,107,0.14);
}
.traffic-stats-page .traffic-table-badge.log {
  color: #aa63e8;
  background: #f8f0ff;
  border-color: rgba(170,99,232,0.14);
}
.traffic-stats-page .traffic-table-scroll {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(35,67,126,0.08);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.traffic-stats-page .traffic-report-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
}
.traffic-stats-page .traffic-report-table th,
.traffic-stats-page .traffic-report-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(35,67,126,0.08);
  text-align: left;
  vertical-align: middle;
  color: #2e558e;
  font-size: 13px;
}
.traffic-stats-page .traffic-report-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #244a88;
  background: linear-gradient(180deg, #f6faff 0%, #eef5ff 100%);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.traffic-stats-page .traffic-report-table tbody tr:nth-child(even) {
  background: #fbfdff;
}
.traffic-stats-page .traffic-report-table tbody tr:hover {
  background: #f2f8ff;
}
.traffic-stats-page .traffic-report-table tbody tr:last-child td {
  border-bottom: 0;
}
.traffic-stats-page .num-cell {
  text-align: right !important;
  white-space: nowrap;
}
.traffic-stats-page .metric-number {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.traffic-stats-page .metric-number.pv {
  color: #0d63f1;
  background: #edf6ff;
}
.traffic-stats-page .metric-number.uv {
  color: #0f8f5d;
  background: #ecfff6;
}
.traffic-stats-page .metric-number.jump {
  color: #8a45d1;
  background: #f8f0ff;
}
.traffic-stats-page .traffic-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.traffic-stats-page .traffic-type-badge.upstream {
  color: #0d63f1;
  background: #edf6ff;
  border: 1px solid rgba(13,99,241,0.12);
}
.traffic-stats-page .traffic-type-badge.downstream {
  color: #8a45d1;
  background: #f8f0ff;
  border: 1px solid rgba(138,69,209,0.12);
}
.traffic-stats-page .channel-cell {
  min-width: 210px;
}
.traffic-stats-page .channel-name {
  color: #163d81;
  font-weight: 900;
  line-height: 1.35;
}
.traffic-stats-page .channel-code {
  margin-top: 4px;
  color: #7a8bad;
  font-size: 12px;
  word-break: break-all;
}
.traffic-stats-page .date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  background: #f4f8ff;
  color: #315a9c;
  font-weight: 900;
  white-space: nowrap;
}
.traffic-stats-page .muted-cell {
  color: #7b8fb3 !important;
  font-size: 12px !important;
  line-height: 1.5;
}
.traffic-stats-page .small-code {
  max-width: 260px;
  color: #60789f;
  font-size: 12px;
  word-break: break-all;
}
.traffic-stats-page .jump-yes,
.traffic-stats-page .jump-no {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.traffic-stats-page .jump-yes {
  color: #8a45d1;
  background: #f8f0ff;
}
.traffic-stats-page .jump-no {
  color: #6b7c9f;
  background: #f1f4f9;
}
.traffic-stats-page .pretty-empty {
  padding: 36px 12px !important;
  color: #7890b6 !important;
  background: #fbfdff;
  font-weight: 700;
}
@media (max-width: 1180px) {
  .traffic-stats-page .traffic-toolbar-grid,
  .traffic-stats-page .traffic-kpi-panel {
    grid-template-columns: 1fr;
  }
  .traffic-stats-page .traffic-stats-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .traffic-stats-page {
    padding-left: 10px;
    padding-right: 10px;
  }
  .traffic-stats-page .traffic-stats-shell {
    padding: 16px;
    border-radius: 22px;
  }
  .traffic-stats-page .traffic-stats-hero,
  .traffic-stats-page .traffic-table-headline {
    flex-direction: column;
  }
  .traffic-stats-page .traffic-stats-filter-form,
  .traffic-stats-page .traffic-stat-cards.compact {
    grid-template-columns: 1fr;
  }
  .traffic-stats-page .traffic-report-table {
    min-width: 920px;
  }
}

/* zgd1: traffic stats table-only layout */
.traffic-stats-page .traffic-filter-card-full {
  margin-top: 14px;
}
.traffic-stats-page .traffic-summary-card {
  margin-top: 16px;
}
.traffic-stats-page .traffic-summary-table {
  min-width: 760px;
}
.traffic-stats-page .traffic-summary-table td:first-child {
  color: #173f7f;
  font-weight: 900;
  white-space: nowrap;
}
.traffic-stats-page .compact-scroll {
  border-radius: 16px;
}
.traffic-stats-page .traffic-filter-card-full + .traffic-table-card,
.traffic-stats-page .traffic-table-card + .traffic-table-card {
  margin-top: 16px;
}

/* zgd1: traffic stats real table-only layout */
.traffic-stats-page .traffic-table-only-shell {
  background: #f4f8ff;
  border-radius: 18px;
  padding: 22px;
}
.traffic-stats-page .traffic-table-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(35,67,126,0.10);
  border-radius: 14px;
  background: #ffffff;
}
.traffic-stats-page .traffic-table-section:first-of-type {
  margin-top: 12px;
}
.traffic-stats-page .traffic-table-section .report-note-text {
  margin: 6px 0 12px;
  color: #5f7398;
  font-size: 13px;
  line-height: 1.55;
}
.traffic-stats-page .traffic-report-table {
  border-collapse: collapse;
  border-spacing: 0;
}
.traffic-stats-page .traffic-report-table caption {
  caption-side: top;
  padding: 10px 12px;
  color: #153b7b;
  background: #eef5ff;
  border-bottom: 1px solid rgba(35,67,126,0.10);
  text-align: left;
  font-weight: 900;
}
.traffic-stats-page .traffic-report-table th,
.traffic-stats-page .traffic-report-table td {
  border: 1px solid rgba(35,67,126,0.10);
  border-left: 0;
  border-right: 0;
  background-clip: padding-box;
}
.traffic-stats-page .traffic-report-table th {
  background: #f6faff;
}
.traffic-stats-page .traffic-report-table .login-input {
  width: 100%;
  min-height: 38px;
  margin: 0;
}
.traffic-stats-page .traffic-filter-table th {
  width: 150px;
  position: static;
}
.traffic-stats-page .traffic-filter-table td {
  min-width: 220px;
}
.traffic-stats-page .traffic-summary-table {
  min-width: 900px;
}
.traffic-stats-page .traffic-total-table,
.traffic-stats-page .traffic-daily-table,
.traffic-stats-page .traffic-log-table {
  min-width: 1180px;
}
.traffic-stats-page .traffic-daily-summary-table {
  min-width: 780px;
}
.traffic-stats-page .empty-row {
  text-align: center !important;
  color: #7b8fb3 !important;
  font-weight: 700;
}

/* zgd1 v40: traffic stats page table-first clean report style */
body.backend-page.traffic-page.traffic-stats-page {
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 18px !important;
  background: #f3f6fb !important;
  color: #111827 !important;
  box-sizing: border-box !important;
}
.traffic-stats-page * { box-sizing: border-box; }
.traffic-stats-page .traffic-stats-container {
  width: min(1580px, 100%) !important;
  margin: 0 auto !important;
}
.traffic-stats-page .traffic-stats-shell {
  width: 100% !important;
  padding: 18px !important;
  border: 1px solid #d9e2ef !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08) !important;
  color: #111827 !important;
}
.traffic-stats-page .traffic-stats-hero {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 0 16px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #ffffff !important;
}
.traffic-stats-page .page-title {
  margin: 0 0 8px !important;
  color: #111827 !important;
  font-size: 24px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}
.traffic-stats-page .page-subtitle {
  margin: 4px 0 0 !important;
  color: #475569 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
.traffic-stats-page .traffic-hero-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-end !important;
}
.traffic-stats-page .traffic-table-section {
  margin: 16px 0 0 !important;
  padding: 14px !important;
  border: 1px solid #dfe7f2 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}
.traffic-stats-page .traffic-section-title {
  margin: 0 0 8px !important;
  color: #0f172a !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}
.traffic-stats-page .report-note-text {
  margin: 0 0 12px !important;
  color: #64748b !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
.traffic-stats-page .traffic-table-scroll {
  width: 100% !important;
  margin-top: 10px !important;
  overflow: auto !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}
.traffic-stats-page .traffic-report-table {
  width: 100% !important;
  min-width: 980px !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 13px !important;
}
.traffic-stats-page .traffic-summary-table,
.traffic-stats-page .traffic-daily-summary-table,
.traffic-stats-page .traffic-filter-table {
  min-width: 760px !important;
}
.traffic-stats-page .traffic-report-table caption {
  caption-side: top !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  text-align: left !important;
}
.traffic-stats-page .traffic-report-table th,
.traffic-stats-page .traffic-report-table td {
  padding: 10px 12px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  color: #111827 !important;
  text-align: left !important;
  vertical-align: middle !important;
  line-height: 1.45 !important;
  white-space: nowrap !important;
}
.traffic-stats-page .traffic-report-table thead th,
.traffic-stats-page .traffic-filter-table th {
  position: static !important;
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}
.traffic-stats-page .traffic-report-table tbody tr:nth-child(even) td {
  background: #fafcff !important;
}
.traffic-stats-page .traffic-report-table tbody tr:hover td {
  background: #eef6ff !important;
}
.traffic-stats-page .num-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}
.traffic-stats-page .small-code,
.traffic-stats-page .mono {
  font-family: Consolas, Monaco, monospace !important;
  color: #334155 !important;
  white-space: normal !important;
  word-break: break-all !important;
}
.traffic-stats-page .login-input {
  width: 100% !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #111827 !important;
}
.traffic-stats-page .filter-action-cell {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}
.traffic-stats-page .empty-row {
  text-align: center !important;
  color: #64748b !important;
  font-weight: 700 !important;
}
@media (max-width: 768px) {
  body.backend-page.traffic-page.traffic-stats-page { padding: 10px !important; }
  .traffic-stats-page .traffic-stats-shell { padding: 12px !important; }
  .traffic-stats-page .traffic-stats-hero { flex-direction: column !important; }
  .traffic-stats-page .traffic-hero-actions { justify-content: flex-start !important; }
  .traffic-stats-page .traffic-report-table { min-width: 900px !important; }
}


/* zgd 20260609: 当前页聊天图片预览，禁止跳转新窗口 */
.human-chat-image-preview-btn {
  display: inline-block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.human-chat-image-preview-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 12px;
}
.human-chat-image {
  cursor: zoom-in;
}
.zgd-human-image-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: max(18px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(84px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.84);
  -webkit-tap-highlight-color: transparent;
}
.zgd-human-image-modal.is-open {
  display: flex;
}
.zgd-human-image-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.zgd-human-image-large {
  display: block;
  width: auto;
  height: auto;
  max-width: min(94vw, 1180px);
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(0,0,0,0.45);
  cursor: zoom-out;
  user-select: none;
  -webkit-user-drag: none;
}
.zgd-human-image-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2147483647;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: #0f172a;
  font-size: 32px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.zgd-human-image-toolbar {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483647;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 42px rgba(0,0,0,0.32);
}
.zgd-human-image-toolbar button {
  min-width: 72px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
body.zgd-human-image-modal-open {
  overflow: hidden !important;
}
@media (max-width: 768px) {
  .zgd-human-image-modal {
    padding: max(58px, env(safe-area-inset-top)) 10px max(88px, env(safe-area-inset-bottom)) 10px;
  }
  .zgd-human-image-large {
    max-width: 92vw;
    max-height: calc(100dvh - 170px);
    border-radius: 10px;
  }
  .zgd-human-image-close {
    width: 44px;
    height: 44px;
    font-size: 30px;
    line-height: 42px;
  }
  .zgd-human-image-toolbar {
    width: calc(100vw - 28px);
    max-width: 360px;
    gap: 8px;
  }
  .zgd-human-image-toolbar button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
  }
}



/* 人工客服快捷发送：QQ 式悬浮面板 */
.backend-quick-reply-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto !important;
  order: 3 !important;
}
.backend-quick-reply-trigger {
  min-height: 46px;
  height: 46px;
  min-width: 92px;
  padding: 0 18px;
  border: 1px solid rgba(39,80,171,.12);
  border-radius: 23px;
  background: rgba(255,255,255,.92);
  color: #2750ab;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}
.backend-quick-reply-trigger:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(39,80,171,.24);
}
.backend-quick-reply-trigger:disabled {
  opacity: .55;
  cursor: not-allowed;
  color: #94a3b8;
  background: rgba(255,255,255,.72);
}
.backend-quick-reply-trigger-arrow {
  font-size: 11px;
  color: #64748b;
  line-height: 1;
  transform: translateY(-1px);
}
.backend-quick-reply-menu {
  position: fixed !important;
  z-index: 99999 !important;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 536px;
  overflow-y: auto;
  padding: 6px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 18px;
  box-shadow: none !important;
  box-sizing: border-box;
}
.backend-quick-reply-menu[hidden] {
  display: none !important;
}
.backend-quick-reply-menu.is-open {
  display: block !important;
}
.backend-quick-reply-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.backend-quick-reply-item {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(203,213,225,.80);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #111827;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
  box-shadow: 0 8px 22px rgba(15,23,42,.10);
}
.backend-quick-reply-item:hover {
  background: rgba(255,255,255,.96);
  border-color: rgba(59,130,246,.45);
  color: #1d4ed8;
}
.backend-quick-reply-index {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(59,130,246,.12);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.backend-quick-reply-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.backend-quick-reply-empty {
  padding: 14px 16px;
  color: #64748b;
  font-size: 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(203,213,225,.80);
  border-radius: 14px;
}
.human-wechat-send-form .login-input { order: 1 !important; }
.human-wechat-send-form .backend-image-upload-btn { order: 2 !important; }
.human-wechat-send-form .backend-quick-reply-wrap { order: 3 !important; }
.human-wechat-send-form .primary-btn { order: 4 !important; }


.quick-reply-admin-page {
  background: #f3f6fb;
}
.quick-reply-admin-shell {
  max-width: 1180px;
  margin: 0 auto;
}
.quick-reply-admin-head {
  margin-bottom: 18px;
}
.quick-reply-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.quick-reply-admin-card {
  background: #fff;
  border: 1px solid #e4edf7;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}
.quick-reply-create-card {
  position: sticky;
  top: 14px;
}
.quick-reply-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}
.quick-reply-create-form,
.quick-reply-config-list,
.quick-reply-config-row {
  display: grid;
  gap: 12px;
}
.quick-reply-form-field {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.quick-reply-form-inline,
.quick-reply-row-top,
.quick-reply-row-footer,
.quick-reply-list-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quick-reply-list-head {
  justify-content: space-between;
  margin-bottom: 14px;
}
.quick-reply-list-head p {
  margin: -6px 0 0;
  color: #64748b;
  font-size: 13px;
}
.quick-reply-count {
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.quick-reply-sort-field,
.quick-reply-row-sort {
  width: 96px;
  flex: 0 0 96px;
}
.quick-reply-title-field {
  flex: 1 1 auto;
}
.quick-reply-active-pill {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.quick-reply-config-row {
  padding: 14px;
  border: 1px solid #e4edf7;
  border-radius: 16px;
  background: #fbfdff;
}
.quick-reply-content-input {
  min-height: 96px;
  height: auto;
  resize: vertical;
  line-height: 1.55;
}
.quick-reply-row-footer {
  justify-content: space-between;
}
.quick-reply-preview {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 6px 10px;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-reply-submit-btn {
  width: 100%;
}
.quick-reply-empty-state {
  padding: 32px 16px;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  display: grid;
  gap: 6px;
  text-align: center;
  background: #f8fafc;
}
.quick-reply-empty-state strong {
  color: #0f172a;
  font-size: 16px;
}
@media (max-width: 900px) {
  .quick-reply-admin-grid {
    grid-template-columns: 1fr;
  }
  .quick-reply-create-card {
    position: static;
  }
}
@media (max-width: 760px) {
  .human-wechat-send-form .backend-quick-reply-wrap {
    flex: 1 1 calc(50% - 6px) !important;
  }
  .human-wechat-send-form .backend-quick-reply-trigger {
    width: 100%;
  }
    .quick-reply-row-top,
  .quick-reply-row-footer,
  .quick-reply-form-inline {
    align-items: stretch;
    flex-direction: column;
  }
  .quick-reply-sort-field,
  .quick-reply-row-sort {
    width: 100%;
    flex: 1 1 auto;
  }
  .quick-reply-preview {
    max-width: 100%;
  }
}

/* zgd 2026-06-20: 支付风险固定客服用复选框勾选，清楚区分限定客服与普通客服 */
.traffic-page .payment-risk-agent-checkbox-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  width: min(760px, 100%);
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #cfe2ff;
  border-radius: 16px;
  background: #f8fbff;
}
.traffic-page .payment-risk-agent-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d6e5f8;
  border-radius: 14px;
  background: #ffffff;
  color: #17315f;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.traffic-page .payment-risk-agent-checkbox:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}
.traffic-page .payment-risk-agent-checkbox.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}
.traffic-page .payment-risk-agent-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #2563eb;
}
.traffic-page .payment-risk-agent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.traffic-page .payment-risk-agent-name {
  font-weight: 700;
  color: #17315f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.traffic-page .payment-risk-agent-username {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.traffic-page .payment-risk-agent-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 760px) {
  .traffic-page .payment-risk-agent-checkbox-panel {
    grid-template-columns: 1fr;
    max-height: 320px;
  }
}

/* ===== zgd 2026-06-20：客服列表新进客户标记 ===== */
.human-wechat-session.is-new-customer {
  background: #ecfeff !important;
  border-left: 4px solid #06b6d4;
  padding-left: 10px;
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, .18), 0 8px 20px rgba(6, 182, 212, .08);
}
.human-wechat-session.is-new-customer .human-wechat-session-row strong {
  color: #0e7490;
  font-weight: 900;
}
.new-customer-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #cffafe;
  color: #0e7490;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  vertical-align: middle;
}
.human-wechat-session.is-new-customer.has-new-reply .new-customer-badge {
  background: #fee2e2;
  color: #dc2626;
}


/* ===== zgd 2026-06-25：重复进入客户标记 ===== */
.repeat-customer-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}
