* { box-sizing: border-box; }
body {
  margin: 0; background: #f5f7fa; color: #1f2329;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px;
}
.hidden { display: none !important; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 24px;
  background: #1769e0; color: #fff;
}
.brand { font-size: 18px; font-weight: 700; }
.user-area { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.link-button { border: 1px solid rgba(255,255,255,0.6); border-radius: 999px; background: transparent; color: #fff; padding: 4px 12px; cursor: pointer; }
.tabs { display: flex; gap: 4px; padding: 0 24px; background: #fff; border-bottom: 1px solid #e5e8eb; overflow-x: auto; }
.tabs button { padding: 14px 20px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #646a73; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: #1769e0; border-bottom-color: #1769e0; font-weight: 600; }
main { max-width: 1080px; margin: 20px auto; padding: 0 20px 60px; }
.view { display: none; }
.view.active { display: block; }
.card {
  margin-bottom: 16px; padding: 20px; border: 1px solid #e5e8eb; border-radius: 14px; background: #fff;
}
.card h2 { margin: 0 0 10px; font-size: 20px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.card h4 { margin: 18px 0 10px; font-size: 14px; }
.muted { color: #8a9099; font-size: 13px; line-height: 1.6; }
.small { font-size: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tip-card { border-color: #cfe0ff; background: #f5f9ff; }
.tip-card p { margin: 8px 0 0; }
.required { color: #d54941; }
.field-label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dcdfe6; border-radius: 8px; background: #fff; color: #1f2329; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1769e0; }
button.primary, button.ghost, button.danger, button.warning {
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 14px;
}
button.small { padding: 6px 14px; font-size: 13px; }
button.tiny { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
button.primary { background: #1769e0; color: #fff; }
button.ghost { background: #eaf2ff; color: #1769e0; border-color: #cfe0ff; }
button.danger { background: #fff0ef; color: #d54941; border-color: #ffcdc9; }
button.warning { background: #fff8e6; color: #8a6d14; border-color: #ffe8a1; }
button.block { display: block; width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; font-weight: 600; }
button:disabled { opacity: 0.6; cursor: wait; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input, .form-row select { flex: 1; min-width: 100px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }

/* 登录卡片 */
.login-card {
  max-width: 400px; margin: 80px auto; padding: 40px 32px; border: 1px solid #e5e8eb; border-radius: 16px; background: #fff;
}
.login-card h2 { text-align: center; margin: 0 0 6px; font-size: 22px; }
.login-card > .muted { text-align: center; margin-bottom: 28px; }

/* 照片 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-item { position: relative; border-radius: 10px; overflow: hidden; background: #f2f3f5; }
.photo-item img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-info { padding: 6px 8px; font-size: 12px; color: #646a73; }
.photo-del { position: absolute; top: 4px; right: 4px; }

/* 商机 */
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #1769e0; color: #fff; font-size: 12px; }
.opp-list-compact { max-height: 220px; overflow: auto; }
.opp-item-compact { padding: 10px 0; border-top: 1px solid #f0f1f2; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.opp-item-compact:first-child { border-top: 0; }
.opp-stage { padding: 2px 8px; border-radius: 4px; color: #fff; font-size: 11px; white-space: nowrap; }
.opp-item { padding: 14px 0; border-top: 1px solid #f0f1f2; }
.opp-item:first-child { border-top: 0; }
.opp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.opp-body { font-size: 13px; color: #4e5969; margin-bottom: 4px; }
.opp-desc { font-size: 12px; margin-bottom: 8px; line-height: 1.5; }
.opp-actions { display: flex; align-items: center; gap: 8px; }

/* 人员管理 */
.admin-user-list { margin-top: 14px; }
.admin-user-item { padding: 12px 0; border-top: 1px solid #f0f1f2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.admin-user-item:first-child { border-top: 0; }
.admin-user-item strong { margin-right: 8px; }
.admin-add-row { margin-bottom: 12px; }

/* 历史标签 */
.rec-sub { display: none; }
.rec-sub.active { display: block; }
.chips.sub { margin-left: 12px; }
.chips.sub button { padding: 5px 14px; font-size: 12px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-card { width: 460px; max-height: 90vh; overflow-y: auto; padding: 28px 24px; border-radius: 16px; background: #fff; }
.modal-card h3 { margin: 0 0 18px; font-size: 18px; }
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* 共享样式（原保留） */
.account-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.account-item { padding: 14px; border: 1px solid #e5e8eb; border-radius: 10px; background: #fff; cursor: pointer; }
.account-item:hover { border-color: #1769e0; background: #f5f9ff; }
.account-item strong { display: block; font-size: 15px; }
.account-item span { display: block; margin-top: 6px; color: #8a9099; font-size: 12px; }
.switch-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.simulate-area { padding: 12px; border-radius: 8px; background: #fbf9ff; }
.simulate-area label { display: block; margin-bottom: 6px; font-size: 13px; }
.simulate-area p { margin: 8px 0 0; }
.location-line { margin-top: 14px; font-size: 13px; }
.result { margin-top: 16px; padding: 14px; border-radius: 8px; background: #f0fbf7; border: 1px solid #b7e8d8; }
.result.bad { background: #fff6f5; border-color: #ffcdc9; }
.result strong { display: block; margin-bottom: 6px; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; }
.chips button { padding: 8px 18px; border: 0; border-radius: 999px; background: #f2f3f5; color: #4e5969; cursor: pointer; }
.chips button.active { background: #1769e0; color: #fff; }
.selectors { display: flex; gap: 10px; }
.selectors select { width: 160px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-box { padding: 14px 8px; border-radius: 10px; background: #f5f8ff; text-align: center; }
.stat-box b { display: block; color: #1769e0; font-size: 24px; }
.stat-box span { display: block; margin-top: 4px; color: #646a73; font-size: 12px; }
.map-box { width: 100%; height: 420px; border-radius: 10px; overflow: hidden; background: #f2f3f5; }
.map-notice, .empty { display: flex; height: 100%; align-items: center; justify-content: center; padding: 20px; color: #8a9099; text-align: center; line-height: 1.7; }
.record-list { max-height: 420px; overflow: auto; }
.record-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid #f0f1f2; }
.record-item:first-child { border-top: 0; }
.record-main { min-width: 0; }
.record-name { font-weight: 600; }
.record-sub { display: block; margin-top: 4px; color: #8a9099; font-size: 12px; }
.tag { padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.tag.valid { background: #e8fffb; color: #00875a; }
.tag.invalid { background: #fff0ef; color: #d54941; }
.bar-item { padding: 10px 0; border-top: 1px solid #f0f1f2; cursor: pointer; }
.bar-item:first-child { border-top: 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 13px; }
.bar-head span:last-child { color: #1769e0; }
.bar-track { height: 8px; margin-top: 8px; border-radius: 999px; background: #f2f3f5; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: #1769e0; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 10px 18px; border-radius: 8px; background: rgba(31,35,41,0.9); color: #fff; z-index: 999; }
@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  main { padding: 0 12px 40px; }
  .form-row { flex-direction: column; }
  .selectors select { width: 100%; }
  .map-box { height: 360px; }
  .modal-card { width: 92%; padding: 20px 16px; }
  .login-card { margin: 40px 16px; padding: 28px 20px; }
  .chips button { padding: 6px 14px; font-size: 12px; }
}