/* ============================================================
   LoanManager — 统一样式表 v2
   金融风格：深海蓝 + 珊瑚金 + 安全绿
   ============================================================ */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #eff6ff;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fffbeb;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
input, select, textarea, button { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ===== 页面容器 ===== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px 40px;
}

/* ===== 顶部导航栏 ===== */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 18px 16px 28px;
  position: relative;
  overflow: hidden;
}
.app-header::before {
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}
.app-header::after {
  content: "";
  position: absolute;
  bottom: -40px; right: 40px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.header-logo { font-size: 22px; margin-bottom: 4px; }
.header-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.header-sub { font-size: 12px; opacity: 0.75; }

/* ===== 表单卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  margin-top: -12px;
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* ===== 分组标题 ===== */
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ===== 表单字段 ===== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.08);
}
.form-input::placeholder { color: #9ca3af; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ===== 金额快捷选择 ===== */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.amount-btn {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--text-secondary);
  text-align: center;
  user-select: none;
}
.amount-btn:hover { border-color: var(--primary); color: var(--primary); }
.amount-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 700;
}

/* ===== 身份选择 ===== */
.identity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.identity-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--text-secondary);
  user-select: none;
}
.identity-btn:hover { border-color: var(--primary); color: var(--primary); }
.identity-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.identity-btn.selected span { font-weight: 600; }

/* ===== 资产多选 ===== */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.asset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--text-secondary);
  user-select: none;
}
.asset-btn:hover { border-color: var(--primary); color: var(--primary); }
.asset-btn.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

/* ===== 信用自评 ===== */
.credit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.credit-btn {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--text-secondary);
  text-align: center;
  user-select: none;
}
.credit-btn:hover { border-color: var(--primary); color: var(--primary); }
.credit-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

/* ===== 隐私提示 ===== */
.form-privacy {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ===== 主按钮 ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(30,64,175,0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(30,64,175,0.35);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  margin-top: 10px;
}
.btn-secondary:hover { background: #e5e7eb; }
.btn-contact {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
}

/* ===== 加载动画 ===== */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
}
.loading-icon { font-size: 36px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; font-weight: 600; color: var(--text); }
.loading-sub { font-size: 12px; color: var(--text-secondary); }
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 2px;
  width: 0;
  transition: width 0.3s ease;
}

/* ===== 推荐结果 ===== */
.result-header { margin-bottom: 14px; }
.result-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.result-sub { font-size: 12px; color: var(--text-secondary); }

.result-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.4s ease forwards;
  background: white;
}
.result-item.top-result {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}
.result-item.top-result::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.top-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: #fef3c7;
  border-radius: 20px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

.result-rank {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 22px;
}

.result-main { margin-bottom: 8px; }
.result-name { font-size: 16px; font-weight: 700; }
.result-bank { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.result-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.score-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.result-item.top-result .score-num { color: var(--accent-dark); }
.score-label { font-size: 11px; color: var(--text-secondary); }

.result-detail {}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-of-type { border-bottom: none; }
.detail-label { color: var(--text-secondary); }
.detail-val { font-weight: 600; }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.feature-tag {
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.result-reasons {
  margin-top: 8px;
  font-size: 12px;
  color: var(--success);
  padding: 6px 10px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

/* ===== 申请建议 ===== */
.result-tips {
  margin: 14px 0 10px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.tips-title { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.tips-content { font-size: 13px; color: var(--text); line-height: 1.6; }
.tip-highlight { color: var(--accent-dark); font-weight: 700; }

/* ===== 联系顾问 ===== */
.contact-box {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
}
.contact-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.contact-sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

/* ===== 隐私政策 ===== */
.privacy-box {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px;
}

/* ===== 提交按钮 ===== */
.btn-submit {
  margin-top: 10px;
}

/* ===== 提交成功 ===== */
.success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 10px;
  gap: 8px;
}
.success-icon { font-size: 52px; }
.success-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--success);
}
.success-sub {
  font-size: 14px;
  color: var(--text-secondary);
}
.success-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 6px;
  max-width: 280px;
}
.success-desc strong { color: var(--primary); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 200;
  transition: transform 0.3s ease;
  max-width: 90%;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== Dashboard ===== */
.dashboard-header {
  background: white;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.dashboard-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-card { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 6px; text-align: center; }
.stat-number { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 10px; color: var(--text-secondary); margin-top: 3px; }

.filter-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  background: white;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  background: white;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.filter-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.customer-list { padding: 10px 12px; }
.customer-item {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.customer-item:active { background: var(--bg); }
.customer-info .customer-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.customer-info .customer-meta { font-size: 11px; color: var(--text-secondary); }
.customer-right { text-align: right; }
.customer-amount { font-size: 15px; font-weight: 700; color: var(--primary); }
.customer-time { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  align-items: flex-end;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px 40px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); }
.detail-value { font-weight: 600; text-align: right; max-width: 60%; }
.status-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.status-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}
.status-btn.on { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }

/* ===== 底部 ===== */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state .emoji { font-size: 44px; margin-bottom: 10px; display: block; }
.empty-state h3 { font-size: 15px; margin-bottom: 4px; color: var(--text); }
.empty-state p { font-size: 12px; }

/* ===== 状态徽章 ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-contacted { background: #dbeafe; color: #1e40af; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }



