/* ========== 贷款申请评估分析系统 —— 全局样式 ========== */
:root {
  --primary: #1a6ff5;
  --primary-dark: #0d4fbf;
  --primary-light: #e8f1fe;
  --success: #00a854;
  --success-light: #e6f7e9;
  --warning: #fa8c16;
  --warning-light: #fff7e6;
  --danger: #f5222d;
  --danger-light: #fff1f0;
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-input: #fafbfc;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-focus: #1a6ff5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #e8ecf1;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 14px;
}

/* ========== Header ========== */
.header {
  background: linear-gradient(135deg, #0d4fbf 0%, #1a6ff5 40%, #4d94ff 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26, 111, 245, 0.3);
}
.header-inner {
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap; /* 说明标签在窄屏换到标题下一行，占满整行 */
  gap: 4px 10px;
  position: relative; /* .header-back 绝对定位在标题行右侧，不挤压标签行 */
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  flex: 0 0 auto;
}
.header-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.header-stats {
  display: flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex: 1 1 100%; /* 标题后面：窄屏独占一行，宽屏由媒体查询改回同行 */
}
.header-stats span {
  background: rgba(255,255,255,0.15);
  padding: 3px 8px;
  border-radius: 10px;
}

/* 返回首页按钮：锚在标题行右侧（top = 上内边距 8 + logo 高 36 的一半），说明标签换到下一行整宽显示，互不遮挡 */
.header-back {
  position: absolute;
  top: 26px;
  right: 14px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.45);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  z-index: 2;
}
.header-back:hover {
  background: rgba(255,255,255,0.34);
  border-color: #fff;
  color: #fff;
}
.header-back:active { transform: translateY(-50%) scale(0.96); }

/* 极窄屏：说明标签字号收紧，保证两枚标签仍完整可见 */
@media (max-width: 360px) {
  .header-stats { font-size: 11px; gap: 5px; }
  .header-stats span { padding: 2px 6px; }
}

/* ========== Layout — 手机端 ========== */
.container {
  max-width: 420px;
  margin: 10px auto 40px;
  padding: 0 8px;
}

/* ========== Steps / Progress ========== */
.steps-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.step {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--success); color: #fff; }
.step-info { font-size: 10px; }
.step-title { font-weight: 600; color: var(--text); font-size: 10px; }
.step-desc { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.step.active .step-title { color: var(--primary); }
.step.done .step-title { color: var(--success); }
.step-divider {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  transition: var(--transition);
}
.step-divider.done { background: var(--success); }

/* ========== Section Cards ========== */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  overflow: hidden;
  transition: var(--transition);
}
.section-card:hover {
  box-shadow: var(--shadow-lg);
}
.section-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.section-header .section-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.header-toggle {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.header-toggle:hover { border-color: var(--primary); color: var(--primary); }
.header-toggle:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.section-body {
  padding: 12px 16px;
}

/* ========== Form Controls ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.form-grid.cols-2 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr; }
.form-grid.cols-4 { grid-template-columns: 1fr; }

.collapsible-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  grid-column: 1 / -1;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required { color: var(--danger); }
.form-label .unit { font-weight: 400; color: var(--text-muted); font-size: 13px; }
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-input);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 111, 245, 0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 13px; color: var(--text-muted); }

/* Upload Zone */
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
}
.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone .upload-icon { font-size: 13px; margin-bottom: 2px; }
.upload-zone .upload-text { font-size: 10px; color: var(--text-secondary); }
.upload-zone .upload-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.upload-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.upload-file-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--success-light);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.upload-file-tag .remove {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}
.upload-file-tag .remove:hover { opacity: 1; }

/* Chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* ========== Buttons ========== */
.btn {
  padding: 10px 24px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #1a6ff5, #0d4fbf);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 111, 245, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 111, 245, 0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-lg { padding: 14px 36px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== Results ========== */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.results-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.results-summary:empty { display: none; }
.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  min-width: 100px;
  flex: 1;
}
.summary-card .num {
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}
.summary-card .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.summary-card.matched .num { color: var(--success); }
.summary-card.best .num { color: var(--primary); }

/* Category Tabs */
.cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cat-tab {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.cat-tab:hover { border-color: var(--primary); }
.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Sub-category filter chips */
.sub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.sub-filter {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.sub-filter:hover { border-color: var(--primary); color: var(--primary); }
.sub-filter.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Product Cards */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.product-card.best-match {
  border-color: var(--primary);
}
.product-card.best-match::before {
  content: '最佳匹配';
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #1a6ff5, #4d94ff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}
.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.product-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.product-bank {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.product-score {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}
.score-high { background: var(--success-light); color: var(--success); }
.score-medium { background: var(--warning-light); color: var(--warning); }
.score-low { background: var(--danger-light); color: var(--danger); }

.product-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.meta-item {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 600; color: var(--text); }
.meta-value.highlight { color: var(--primary); }
.meta-value.rate { color: var(--success); }

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }

.product-actions {
  display: flex;
  gap: 8px;
}
.product-actions .btn { flex: 1; font-size: 13px; padding: 8px 16px; }

/* No Match */
.no-match-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.no-match-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.gap-card {
  background: var(--warning-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.gap-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}
.gap-info { flex: 1; }
.gap-reason { font-weight: 600; font-size: 14px; }
.gap-detail { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.gap-count {
  background: var(--warning);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.gap-more-btn {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px dashed var(--warning);
  color: var(--warning);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
  transition: background .2s;
}
.gap-more-btn:hover { background: var(--warning-light); }

/* Animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.loading-box {
  text-align: center;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-secondary); font-weight: 600; }

/* Detail Panel */
.detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 420px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}
.detail-close {
  float: right;
  cursor: pointer;
  font-size: 19px;
  color: var(--text-muted);
  background: none;
  border: none;
  line-height: 1;
}
.detail-close:hover { color: var(--text); }

/* Hide / Show */
.hidden { display: none !important; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

/* ========== AI 征信分析 ========== */
/* Upload Zone */
.credit-upload-zone {
  border: 2px dashed #c5d5f0;
  border-radius: var(--radius);
  padding: 0;
  transition: var(--transition);
  cursor: pointer;
  background: linear-gradient(135deg, #f8faff 0%, #eef3ff 100%);
}
.credit-upload-zone:hover, .credit-upload-zone.drag-over {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eef3ff 0%, #dce8ff 100%);
  box-shadow: 0 0 0 2px rgba(26,111,245,0.08);
}
.credit-upload-inner {
  padding: 12px 10px;
  text-align: center;
}
.upload-visual { margin-bottom: 6px; }
.upload-visual svg { display: inline-block; width: 40px; height: 40px; }
.upload-text-primary {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 3px;
}
.upload-text-hint {
  font-size: 10px;
  color: var(--text-muted);
}
.upload-text-hint .hint-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}
.upload-text-hint .hint-link:hover { opacity: .85; }

/* AI Analyzing */
.ai-analyzing {
  padding: 20px 0;
}
.ai-progress-bar-wrapper {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ai-progress-bar {
  height: 100%;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ai-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a6ff5, #4d94ff);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.ai-step-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
.ai-step-icon { font-size: 18px; }
.ai-step-text { font-size: 14px; color: var(--primary); font-weight: 600; }
.ai-step-list { display: flex; flex-direction: column; gap: 4px; }
.ai-mini-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 8px;
}
.ai-mini-step.done { color: var(--success); }

/* Credit Dashboard（嵌入式） */
.credit-dashboard {
  animation: fadeInUp 0.4s ease;
}
.credit-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.credit-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.credit-file-badge {
  font-size: 12px;
  background: rgba(26,111,245,0.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.credit-file-date { font-size: 13px; color: var(--text-muted); }

.credit-metrics {
  margin-bottom: 4px;
}
.credit-metric-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
  border: 1px solid var(--border);
}
.credit-metric-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}
.credit-metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.credit-metric-conf {
  font-size: 11px;
  color: var(--success);
  margin-top: 2px;
}

.credit-detail-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
  margin-bottom: 4px;
}
.credit-detail-panel {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  border: 1px solid var(--border);
  min-height: auto;
  display: flex;
  flex-direction: column;
  margin-bottom: 3px;
}
.credit-detail-panels .credit-detail-panel {
  margin-bottom: 0;
}
.credit-detail-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.credit-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 1;
  align-content: start;
}
.credit-detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 1px 0;
}
.cd-label { color: var(--text-muted); }
.cd-value { font-weight: 700; color: #1a1a2e; }
.cd-warn { color: var(--warning); }
.cd-danger { color: var(--danger); font-weight: 800; font-size: 14px; }

.credit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ========== AI 全屏分析面板 Overlay ========== */
.ai-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ai-panel {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  max-width: 680px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.ai-close {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 18px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  line-height: 1;
}
.ai-close:hover { color: var(--text); }

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.ai-panel-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.ai-panel-title { font-size: 16px; font-weight: 700; }
.ai-panel-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* 进度 */
.ai-panel-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.ai-panel-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.ai-panel-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a6ff5, #4d94ff, #7cb3ff);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}
.ai-panel-progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: right;
}

/* AI 步骤列表 */
.ai-panel-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-panel-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.ai-panel-step.done { color: var(--success); }
.ai-panel-step.current { color: var(--primary); font-weight: 600; }
.ai-panel-step-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.ai-panel-step.done .ai-panel-step-dot { background: var(--success); }
.ai-panel-step.current .ai-panel-step-dot {
  background: var(--primary);
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,111,245,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(26,111,245,0); }
}

/* 结果卡片 */
.ai-result-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ai-result-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
}
.ai-result-card-title { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.ai-result-card-value { font-size: 21px; font-weight: 800; }
.ai-result-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.ai-result-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.ai-result-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ai-tag-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.ai-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.ai-tag-good { background: var(--success-light); color: var(--success); }
.ai-tag-warn { background: var(--warning-light); color: var(--warning); }

.ai-result-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.ai-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ========== Borderline Match ========== */
.product-card.borderline-match {
  border-color: var(--warning);
  background: linear-gradient(135deg, #fffdf5 0%, #fff 100%);
}
.badge-warning {
  display: inline-block;
  font-size: 12px;
  background: var(--warning-light);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.summary-card.borderline {
  background: var(--warning-light);
}
.summary-card.borderline .num { color: var(--warning); }

/* ========== 客群分类面板 ========== */
.classification-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.classification-panel:empty {
  display: none;
}
.cls-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cls-level {
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  min-width: 80px;
}
.cls-level-text {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}
.cls-level-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.cls-level-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cls-total {
  flex: 1;
}
.cls-total-num {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
}
.cls-total-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.cls-total-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.cls-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.cls-col {
  display: flex;
  flex-direction: column;
}
.cls-col .cls-table {
  flex: 1;
}
.cls-col-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.cls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cls-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.cls-table td:first-child { width: 55px; }
.cls-table td:nth-child(2) { width: 32px; text-align: center; }
.cls-table td:nth-child(3) { width: 38px; text-align: right; }
.cls-table td:last-child { color: var(--text-muted); }
.cls-table tr:last-child td { border-bottom: none; }

@media (max-width: 900px) {
  .cls-cols { grid-template-columns: 1fr; }
  .cls-header { flex-direction: column; align-items: flex-start; }
}

/* ========== 手机端单列 ========== */
.product-grid { grid-template-columns: 1fr; }
.results-summary { flex-direction: column; }
.summary-card { min-width: auto; }
.ai-result-extra { grid-template-columns: 1fr; }
.credit-detail-panels { grid-template-columns: 1fr; }

/* ========== 合规风险提示横幅（《金融产品网络营销管理办法》要求） ========== */
.compliance-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.compliance-banner .cb-icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.compliance-banner .cb-title { font-size: 13px; font-weight: 700; color: #ad6800; margin-bottom: 4px; }
.compliance-banner .cb-text { font-size: 12px; line-height: 1.7; color: #8c5a00; }

/* ========== 强制阅读确认弹层 ========== */
.notice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}
.notice-overlay.hidden { display: none; }
.notice-box {
  background: #fff;
  border-radius: 14px;
  padding: 22px 20px 18px;
  width: 100%;
  max-width: 460px;
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
}
.notice-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px; text-align: center; }
.notice-content p { font-size: 13px; line-height: 1.85; color: var(--text-muted); margin: 0 0 10px; }
.notice-content strong { color: var(--text); }
.notice-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px 0;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.notice-btn:disabled { background: #c8cdd6; cursor: not-allowed; }

/* ============================================================
   贷款申请评估分析报告（结果页首屏主体）
   ============================================================ */

/* 报告标题 */
.report-header {
  background: linear-gradient(135deg, #0f2d5c 0%, #1a6ff5 100%);
  border-radius: 14px;
  padding: 22px 20px;
  color: #fff;
  margin-bottom: 14px;
}
.report-header .rh-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.report-header .rh-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.35;
}
.report-header .rh-sub {
  font-size: 12.5px;
  opacity: .88;
  margin-top: 8px;
  line-height: 1.7;
}
.report-header .rh-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 14.5px;
  line-height: 1.8;
}
.report-header .rh-meta-row b {
  font-weight: 800;
  letter-spacing: .3px;
}

/* 深度报告容器 */
.deep-report { display: none; margin-top: 0; }
.deep-report.show { display: block; }
.deep-report .dr-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.deep-report .dr-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.deep-report .dr-score-wrap {
  background: linear-gradient(135deg, #1a6ff5, #4d94ff);
  border: none;
}
.deep-report .dr-score-card {
  background: transparent;
  color: #fff;
  border-radius: 12px;
  padding: 6px 0 0;
  text-align: center;
}
.deep-report .dr-score-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.deep-report .dr-score-grade {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .22);
  margin-top: 8px;
}
.deep-report .dr-score-summ {
  font-size: 12.5px;
  margin-top: 10px;
  opacity: .92;
  line-height: 1.7;
  text-align: left;
}
.deep-report .dr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}
.deep-report .dr-bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.deep-report .dr-bank-row:last-child { border-bottom: none; }
.deep-report .dr-bank-name { color: var(--text); font-weight: 600; white-space: nowrap; }
.deep-report .dr-bank-bar {
  flex: 1;
  margin: 0 12px;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}
.deep-report .dr-bank-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #52c41a, #1a6ff5);
  transition: width .5s;
}
.deep-report .dr-bank-bar-fill.low { background: #ff4d4f; }
.deep-report .dr-bank-bar-fill.mid { background: #faad14; }
.deep-report .dr-bank-rate {
  width: 48px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
}
.deep-report .dr-bank-rate.high { color: #52c41a; }
.deep-report .dr-bank-rate.mid { color: #faad14; }
.deep-report .dr-bank-rate.low { color: #ff4d4f; }
.deep-report .dr-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.75;
}
.deep-report .dr-bar-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.deep-report .dr-stat-cell {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
}
.deep-report .dr-stat-cell .lbl { font-size: 11px; color: var(--text-muted); }
.deep-report .dr-stat-cell .val { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 2px; }
.deep-report .dr-stat-cell .val.good { color: #52c41a; }
.deep-report .dr-stat-cell .val.warn { color: #faad14; }
.deep-report .dr-stat-cell .val.bad { color: #ff4d4f; }
.deep-report .dr-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.deep-report .dr-profile-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.deep-report .dr-profile-item .p-lbl { color: var(--text-muted); white-space: nowrap; }
.deep-report .dr-profile-item .p-val { color: var(--text); font-weight: 600; text-align: right; }
.deep-report .dr-risk-list { list-style: none; padding: 0; margin: 0; }
.deep-report .dr-risk-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  line-height: 1.6;
}
.deep-report .dr-risk-item:last-child { border-bottom: none; }
.deep-report .dr-risk-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}
.deep-report .dr-risk-dot.high { background: #ff4d4f; box-shadow: 0 0 0 3px rgba(255, 77, 79, .18); }
.deep-report .dr-risk-dot.mid { background: #faad14; box-shadow: 0 0 0 3px rgba(250, 173, 20, .18); }
.deep-report .dr-risk-dot.low { background: #52c41a; box-shadow: 0 0 0 3px rgba(82, 196, 26, .18); }
.deep-report .dr-risk-text { flex: 1; }
.deep-report .dr-risk-title { font-weight: 600; color: var(--text); }
.deep-report .dr-risk-desc { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.deep-report .dr-adv-list { counter-reset: dradv; padding: 0; margin: 0; list-style: none; }
.deep-report .dr-adv-item {
  counter-increment: dradv;
  position: relative;
  padding: 9px 12px 9px 36px;
  margin-bottom: 6px;
  background: #f6ffed;
  border-left: 3px solid #52c41a;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.65;
}
.deep-report .dr-adv-item::before {
  content: counter(dradv);
  position: absolute;
  left: 8px;
  top: 9px;
  width: 20px;
  height: 20px;
  background: #52c41a;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deep-report .dr-tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.deep-report .dr-tip {
  background: #f0f7ff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.deep-report .dr-tip b { color: var(--primary); display: block; margin-bottom: 2px; }
.deep-report .dr-watermark {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  line-height: 1.7;
}

/* ===== 风险因素序号徽标 ===== */
.deep-report .dr-risk-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deep-report .dr-risk-num.high { background: #ff4d4f; }
.deep-report .dr-risk-num.mid { background: #faad14; }
.deep-report .dr-risk-num.low { background: #52c41a; }
.deep-report .dr-risk-hit {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffa39e;
  vertical-align: 1px;
}

/* ===== 银行产品准入条件比对（合规版 · 三类银行合并表格，参数名称只列一次） ===== */
.deep-report .dr-cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.deep-report .dr-cmp-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 12px; }
.deep-report .dr-cmp-table th,
.deep-report .dr-cmp-table td { padding: 7px 8px; text-align: center; border: 1px solid #e8ecf3; white-space: nowrap; }
.deep-report .dr-cmp-table thead th { background: #f4f7fb; color: var(--text); }
.deep-report .dr-cmp-table thead th.cmp-item-h { background: #eef3fa; color: var(--text-muted); font-weight: 600; }
.deep-report .dr-cmp-table .cmp-th-sum { display: block; font-size: 10.5px; font-weight: 600; margin-top: 2px; color: var(--text-muted); }
.deep-report .dr-cmp-table thead th.ok .cmp-th-sum { color: #52c41a; }
.deep-report .dr-cmp-table thead th.mid .cmp-th-sum { color: #d48806; }
.deep-report .dr-cmp-table thead th.bad .cmp-th-sum { color: #cf1322; }
.deep-report .dr-cmp-table td.cmp-name { text-align: left; color: var(--text); font-weight: 600; background: #fafbfd; }
.deep-report .dr-cmp-table td.cmp-my { color: var(--text); font-weight: 600; }
.deep-report .dr-cmp-table td.ok { color: #52c41a; font-weight: 600; background: #f6ffed; }
.deep-report .dr-cmp-table td.fail { color: #cf1322; font-weight: 600; background: #fff1f0; }
.deep-report .dr-cmp-table td.na { color: #999; }

/* ===== 报告级免责声明（合规版） ===== */
.deep-report .dr-disclaimer {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.deep-report .dr-disclaimer .dc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.deep-report .dr-disclaimer .dc-body {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.9;
}
.deep-report .dr-disclaimer .dc-body b { color: #6b7280; }

/* 可申请产品参考（折叠区） */
.products-collapse { margin-top: 6px; }
.pc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
.pc-toggle:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(26, 111, 245, .1); }
.pc-toggle .pc-label { flex: 1; }
.pc-toggle .pc-count { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.pc-toggle .pc-arrow { font-size: 13px; color: var(--text-muted); }
.pc-body { padding-top: 18px; }
.pc-body.hidden { display: none; }

/* 按钮下方说明 */
.btn-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
}
.btn-tip .tip-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}
.btn-tip .tip-link:hover { opacity: .85; }
/* 提交按钮区：纵向排列，提示文案位于按钮正下方 */
.btn-group-col {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
/* 主操作并排（主按钮 + 次级按钮），窄屏自动换行 */
.main-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* 未上传征信时高亮提醒 */
.section-card.flash-attention {
  animation: flashAttention 1.2s ease-in-out 2;
  border-color: var(--primary) !important;
}
@keyframes flashAttention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 111, 245, 0); }
  50% { box-shadow: 0 0 0 6px rgba(26, 111, 245, .18); }
}

/* 打印：仅导出评估报告本体 */
#printArea { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  #printArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  #printArea .report-header,
  #printArea .dr-section,
  #printArea .dr-disclaimer,
  #printArea .dr-score-wrap {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #printArea .dr-section { break-inside: avoid; }
  @page { margin: 12mm; }
}

@media (max-width: 600px) {
  .report-header { padding: 18px 16px; }
  .report-header .rh-title { font-size: 18px; }
  .deep-report .dr-bar-2col { grid-template-columns: 1fr; }
  /* 资质概览 / 征信报告数据汇总：手机端两列紧凑排布，节省纵向空间 */
  .deep-report .dr-profile-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .deep-report .dr-profile-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .deep-report .dr-profile-item .p-lbl { white-space: normal; font-size: 10.5px; line-height: 1.4; }
  .deep-report .dr-profile-item .p-val { text-align: left; font-size: 12.5px; }
  /* 展开三角保持在按钮右侧，不换行掉到下方 */
  .pc-toggle { flex-wrap: nowrap; }
  .pc-toggle .pc-label { min-width: 0; }
  .pc-toggle .pc-count { font-size: 11px; white-space: nowrap; }
}

/* ========== 电脑版桌面布局（宽度 ≥ 768px 时启用，不再按手机单列显示） ========== */
@media (min-width: 768px) {
  /* 头部与主容器放宽到桌面宽度 */
  .header-inner { max-width: 1080px; padding: 10px 20px; }
  .container { max-width: 1080px; margin: 20px auto 60px; padding: 0 16px; }
  body { font-size: 14px; }

  /* 宽屏：说明标签回到标题后面同一行，返回按钮跟随右内边距 */
  .header-stats { flex: 0 0 auto; }
  .header-back { top: 28px; right: 20px; }

  /* 表单区：上下结构单列堆叠，收入/社保/公积金/房产/车辆各占一行 */
  #step-input {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }
  #step-input > .section-card { margin-bottom: 0; }
  #step-input > .btn-group { margin-top: 6px; justify-content: center; }

  /* 表单字段恢复多列 */
  .form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .collapsible-fields { grid-template-columns: repeat(2, 1fr); }

  /* 收入信息：月工资收入 / 发放形式 / 最高学历 三列同排 */
  .form-grid.income-grid { grid-template-columns: repeat(3, 1fr); }

  /* 结果区恢复网格 */
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .results-summary { flex-direction: row; }
  .ai-result-extra { grid-template-columns: repeat(2, 1fr); }
  .credit-detail-panels { grid-template-columns: repeat(2, 1fr); }

  /* 弹层加宽到桌面尺寸 */
  .detail-panel { max-width: 720px; }
  .ai-panel { max-width: 860px; }

  /* 步骤条居中收窄，视觉更像桌面流程条 */
  .steps-wrapper { max-width: 640px; margin: 0 auto 14px; }
}

/* ===== 学历滑动选择器 ===== */
.edu-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1200;
}
.edu-sheet {
  /* 居中弹窗（不再贴底） */
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px); max-width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
  z-index: 1201;
}
.edu-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
}
.edu-sheet-title {
  font-size: 15px; font-weight: 600; color: #1f2937;
}
.edu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14.5px; color: #6b7280; padding: 4px 6px;
}
.edu-btn-ok { color: #2563eb; font-weight: 600; }
.edu-wheel-wrap { position: relative; height: 220px; overflow: hidden; }
.edu-highlight {
  position: absolute; left: 14px; right: 14px; top: 88px; height: 44px;
  border-radius: 10px; background: #eef4ff;
  pointer-events: none;
  z-index: 0;            /* 沉在选项文字下面，避免遮住选中项 */
}
.edu-wheel {
  position: relative;    /* 抬到色条之上，选中项文字正常显示 */
  z-index: 1;
  height: 220px; overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 88px 0;
  scrollbar-width: none;
}
.edu-wheel::-webkit-scrollbar { display: none; }
.edu-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15.5px; color: #6b7280;
  scroll-snap-align: center;
  cursor: pointer;
  transition: color .15s;
}
.edu-item.active { color: #2563eb; font-weight: 700; }

/* ===== 手机端报告长图导出 ===== */
#imgExportHolder {
  position: fixed;
  left: -10000px; top: 0;
  width: 760px;
  z-index: -1;
  pointer-events: none;
}
#imgExportHolder .imgx-render {
  width: 720px;
  padding: 20px;
  background: #eef2f8;
  box-sizing: content-box;
}
.imgx-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 1300;
}
.imgx-modal {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 560px);
  max-height: 88vh;
  background: #fff;
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 1301;
}
.imgx-title {
  font-size: 15.5px; font-weight: 700; color: #1f2937;
  text-align: center; padding: 14px 12px 4px;
}
.imgx-hint {
  font-size: 13px; color: #2563eb;
  text-align: center; padding: 0 12px 10px;
}
.imgx-body {
  overflow-y: auto;
  padding: 10px 12px;
  border-top: 1px solid #f0f0f0;
  -webkit-overflow-scrolling: touch;
}
.imgx-body img {
  width: 100%; display: block;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.imgx-actions {
  display: flex; gap: 10px;
  padding: 12px;
  border-top: 1px solid #f0f0f0;
}
.imgx-btn {
  flex: 1; text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff; color: #374151;
  font-size: 14.5px; cursor: pointer;
  text-decoration: none;
}
.imgx-btn-primary {
  background: #2563eb; border-color: #2563eb;
  color: #fff; font-weight: 600;
}

/* ===== 报告末尾：人工服务 + 导出报告 并列按钮 ===== */
.cls-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.cls-actions .btn {
  flex: 1;
  min-width: 0;
}
@media (max-width: 480px) {
  .cls-actions { gap: 6px; }
  .cls-actions .btn {
    padding: 10px 2px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* ===== 评估城市选择条 ===== */
.city-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.city-bar-label { font-size: 14px; color: #374151; font-weight: 600; }
.city-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.city-bar-btn b { font-weight: 700; }
.city-bar-arrow { font-size: 11px; opacity: .7; }
.city-bar-count { font-size: 12px; color: #9ca3af; margin-left: auto; }

/* ===== 城市选择弹层 ===== */
.cityp-mask {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0, 0, 0, .45);
}
.cityp-modal {
  position: fixed; z-index: 9999;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  max-height: 80vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}
.cityp-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.cityp-title { font-size: 16px; font-weight: 700; }
.cityp-close {
  border: none; background: #f3f4f6;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; color: #6b7280; font-size: 13px;
}
.cityp-sub { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }
.cityp-provs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}
.cityp-prov {
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 12px; color: #4b5563;
  padding: 4px 10px; border-radius: 999px;
  cursor: pointer;
}
.cityp-prov.active {
  background: #2563eb; border-color: #2563eb; color: #fff;
  font-weight: 600;
}
.cityp-cities {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 12px;
}
.cityp-city {
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 13px; color: #374151;
  padding: 8px 4px; border-radius: 10px;
  cursor: pointer; text-align: center;
}
.cityp-city.active {
  background: #eff6ff; border-color: #2563eb; color: #1d4ed8;
  font-weight: 700;
}
@media (max-width: 480px) {
  .cityp-cities { grid-template-columns: repeat(3, 1fr); }
  /* 手机端城市条保持单行：标签 + 城市 + 产品数量一排显示 */
  .city-bar { flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
  .city-bar-label { flex: 0 0 auto; font-size: 13px; white-space: nowrap; }
  .city-bar-btn { flex: 0 0 auto; font-size: 13px; padding: 5px 10px; }
  .city-bar-count {
    flex: 1 1 auto; min-width: 0; margin-left: auto;
    font-size: 11px; white-space: nowrap; text-align: right;
    overflow: hidden; text-overflow: ellipsis;
  }
}
/* 超窄屏（≤360px）：再压缩一档，保证「城市 + 产品数量」仍在同一行 */
@media (max-width: 360px) {
  .city-bar { gap: 6px; padding: 9px 10px; }
  .city-bar-label { font-size: 12px; }
  .city-bar-btn { font-size: 12px; padding: 4px 8px; }
  .city-bar-count { font-size: 10px; }
}
