:root {
  --m-bg: #f1f5f9;
  --m-surface: #ffffff;
  --m-sidebar: #0b1630;
  --m-sidebar-hover: rgba(255, 255, 255, 0.08);
  --m-sidebar-active: rgba(37, 99, 235, 0.28);
  --m-primary: #2563eb;
  --m-primary-soft: #eff6ff;
  --m-teal: #0d9488;
  --m-teal-soft: #f0fdfa;
  --m-danger: #dc2626;
  --m-danger-soft: #fef2f2;
  --m-amber: #d97706;
  --m-amber-soft: #fffbeb;
  --m-green: #16a34a;
  --m-green-soft: #f0fdf4;
  --m-text: #0f172a;
  --m-text-2: #475569;
  --m-muted: #64748b;
  --m-border: #e2e8f0;
  --m-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --m-radius: 14px;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ==================== 精致分屏登录页 ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 15% 20%, #dbeafe 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, #ccfbf1 0%, transparent 45%),
              #eef2f8;
}

.login-shell {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login-brand {
  background: linear-gradient(145deg, #081229 0%, #142c66 60%, #1d4ed8 100%);
  color: #ffffff;
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  bottom: -90px;
  right: -70px;
  pointer-events: none;
}

.brand-mark-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
}

.login-brand h1 {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 12px;
}

.login-brand p {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.65;
}

.login-perks {
  list-style: none;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 12px;
  border-radius: 10px;
}

.login-form-pane {
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-pane h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--m-text);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--m-muted);
  margin-bottom: 24px;
}

.field {
  margin-bottom: 15px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--m-text);
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.demo-switch {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--m-border);
}

.demo-switch-label {
  font-size: 12px;
  color: var(--m-muted);
  margin-bottom: 8px;
}

.demo-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-pill {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.demo-pill:hover {
  border-color: var(--m-primary);
  color: var(--m-primary);
  background: var(--m-primary-soft);
}

/* ==================== 主体 SaaS 侧边栏布局 ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 256px;
  background: var(--m-sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  z-index: 30;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sb-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.sb-brand-sub {
  font-size: 11px;
  color: #93c5fd;
}

.sb-store-card {
  margin: 14px 4px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
}

.sb-store-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.sb-store-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}

.sb-mode-tag {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.nav-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--m-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--m-sidebar-active);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 99px;
}

.sb-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sb-user-name { font-size: 13px; font-weight: 700; color: #fff; }
.sb-user-email { font-size: 11px; color: #94a3b8; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sb-logout {
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sb-logout:hover { background: rgba(239, 68, 68, 0.25); color: #fecaca; }

/* 右侧主工作区 */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: #ffffff;
  border-bottom: 1px solid var(--m-border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 15;
}

.page-title-group h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--m-text);
}

.page-title-group p {
  font-size: 12.5px;
  color: var(--m-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--m-border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
}

.content-wrap {
  padding: 22px 28px 48px;
  max-width: 1180px;
  width: 100%;
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover { transform: translateY(-0.5px); opacity: 0.94; }
.btn-primary { background: var(--m-primary); color: #ffffff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22); }
.btn-teal { background: var(--m-teal); color: #ffffff; }
.btn-outline { background: #ffffff; color: var(--m-text); border: 1px solid #cbd5e1; }
.btn-soft { background: var(--m-primary-soft); color: var(--m-primary); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

/* 卡片与指标 */
.card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 20px;
  box-shadow: var(--m-shadow);
  margin-bottom: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 16px 18px;
  box-shadow: var(--m-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label { font-size: 12.5px; color: var(--m-muted); font-weight: 600; }
.kpi-val { font-size: 28px; font-weight: 900; color: var(--m-text); margin-top: 4px; line-height: 1.1; }
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* 筛选与搜索栏 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--m-border);
  background: #f8fafc;
  color: var(--m-text-2);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chip.active {
  background: var(--m-text);
  color: #ffffff;
  border-color: var(--m-text);
}

.search-box {
  position: relative;
  min-width: 230px;
}

.search-box input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 13px;
  background: #ffffff;
}

.search-box input:focus {
  outline: none;
  border-color: var(--m-primary);
}

/* 干净清爽的线索表格 */
.table-wrap { width: 100%; overflow-x: auto; }

.clean-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.clean-table th {
  background: #f8fafc;
  color: var(--m-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--m-border);
  white-space: nowrap;
}

.clean-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.clean-table tbody tr {
  transition: background 0.12s;
}

.clean-table tbody tr:hover {
  background: #f8fafc;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--m-primary);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--m-text-2);
}

.copy-mini {
  border: none;
  background: #f1f5f9;
  color: var(--m-muted);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  cursor: pointer;
}

.copy-mini:hover { background: #e2e8f0; color: var(--m-text); }

.note-preview {
  max-width: 280px;
  font-size: 12.5px;
  color: var(--m-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.merchant-reply-tag {
  margin-top: 5px;
  font-size: 12px;
  color: var(--m-teal);
  background: var(--m-teal-soft);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-red { background: var(--m-danger-soft); color: var(--m-danger); }
.pill-amber { background: var(--m-amber-soft); color: var(--m-amber); }
.pill-blue { background: var(--m-primary-soft); color: var(--m-primary); }
.pill-green { background: var(--m-green-soft); color: var(--m-green); }
.pill-gray { background: #f1f5f9; color: #64748b; }

/* ==================== 右侧滑出跟进抽屉 ==================== */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  height: 100%;
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--m-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 20px 22px;
  flex: 1;
  overflow-y: auto;
}

.drawer-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--m-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.detail-summary-box {
  background: #f8fafc;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--m-muted); }
.detail-row strong { color: var(--m-text); text-align: right; }

.status-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.status-opt {
  border: 1.5px solid var(--m-border);
  background: #fff;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--m-text-2);
  text-align: center;
}

.status-opt.selected {
  border-color: var(--m-primary);
  background: var(--m-primary-soft);
  color: var(--m-primary);
}

/* ==================== GEO 体检报告视觉升级 ==================== */
.geo-hero {
  background: linear-gradient(135deg, #0b1630 0%, #16306e 60%, #1e40af 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.score-ring {
  width: 112px;
  height: 112px;
  position: relative;
  flex-shrink: 0;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-num { font-size: 28px; font-weight: 900; color: #ffffff; line-height: 1; }
.score-ring-sub { font-size: 11px; color: #93c5fd; margin-top: 3px; }

.geo-hero-info { flex: 1; min-width: 240px; }
.geo-hero-info h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.geo-hero-info p { font-size: 13.5px; color: #dbeafe; line-height: 1.6; }

.geo-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.geo-mini-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.geo-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.geo-group-card {
  background: #ffffff;
  border: 1px solid var(--m-border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--m-shadow);
}

.geo-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.geo-group-title { font-size: 14.5px; font-weight: 800; color: var(--m-text); }

.geo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9;
  font-size: 13px;
  color: var(--m-text-2);
}

.geo-row:last-child { border-bottom: none; }

/* ==================== 已上线内容预览（服务/案例/FAQ） ==================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.svc-card {
  background: #ffffff;
  border: 1px solid var(--m-border);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.svc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.svc-price {
  font-size: 15px;
  font-weight: 900;
  color: var(--m-primary);
  white-space: nowrap;
}

.faq-card {
  background: #ffffff;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 15px 18px;
  margin-bottom: 10px;
}

.faq-q { font-size: 14.5px; font-weight: 800; color: var(--m-text); margin-bottom: 6px; }
.faq-a { font-size: 13.5px; color: var(--m-text-2); line-height: 1.65; }

/* ==================== 门店档案双栏 ==================== */
.profile-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 13px;
}

.info-item.full { grid-column: 1 / -1; }
.info-k { font-size: 12px; color: var(--m-muted); margin-bottom: 3px; }
.info-v { font-size: 14px; font-weight: 700; color: var(--m-text); }

.kw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.kw-tag {
  background: var(--m-primary-soft);
  color: var(--m-primary);
  border: 1px solid #bfdbfe;
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
  z-index: 99;
  display: none;
}

/* 响应式移动端适配 */
@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .geo-groups, .content-grid, .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .sidebar {
    position: fixed;
    left: -270px;
    transition: left 0.2s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .page-header { padding: 14px 16px; }
  .content-wrap { padding: 16px 14px 40px; }
  .info-list { grid-template-columns: 1fr; }
}
