:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --sidebar: #1e293b;
  --sidebar-text: #cbd5e1;
  --red: #dc2626;
  --green: #16a34a;
  --orange: #ea580c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-2); margin-bottom: 28px; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 18px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .err { color: var(--red); font-size: 13px; margin-bottom: 12px; min-height: 18px; }

/* 登录页 LOGO（预留，后续替换 assets/brand-logo.png） */
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { height: 54px; max-width: 200px; object-fit: contain; }
.login-logo img.hidden { display: none; }
.login-logo .logo-fallback { display: none; font-size: 32px; font-weight: 800; color: var(--primary); letter-spacing: 3px; }
.login-logo img.hidden ~ .logo-fallback { display: inline-block; }

/* 记住密码复选框 */
.remember-row { display: flex; align-items: center; gap: 8px; margin: -8px 0 10px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.remember-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 220px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .logo { padding: 20px 20px 16px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .logo span { font-size: 12px; font-weight: 400; color: var(--sidebar-text); display: block; margin-top: 2px; }
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; cursor: pointer;
  color: var(--sidebar-text); transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.25); color: #fff; border-left-color: var(--primary); }
.nav-item .ic { width: 20px; text-align: center; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.sidebar .foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0;
}
.topbar h2 { font-size: 17px; }
.topbar .spacer { flex: 1; }
.topbar .user-chip { color: var(--text-2); font-size: 13px; }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stat-card .num { font-size: 30px; font-weight: 700; }
.stat-card .label { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.stat-card.c-normal .num { color: var(--green); }
.stat-card.c-abnormal .num { color: var(--red); }
.stat-card.c-pending .num { color: var(--orange); }
.stat-card.c-primary .num { color: var(--primary); }
.stat-card.c-following .num { color: #1d4ed8; }
.stat-card.c-decorating .num { color: #a16207; }
.stat-card.c-appeal .num { color: #7e22ce; }
.stat-card.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.10); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
.toolbar .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f9fafb; color: var(--text-2); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbfc; }
td.name-cell { font-weight: 500; }
td.addr-cell { max-width: 260px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 16px; color: var(--text-2); font-size: 13px; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.tag-normal { background: #dcfce7; color: #15803d; }
.tag-abnormal { background: #fee2e2; color: #b91c1c; }
.tag-wait { background: #ffedd5; color: #c2410c; }
.tag-audit { background: #fef3c7; color: #b45309; }
.tag-brand { background: #dbeafe; color: #1d4ed8; }
.tag-inactive { background: #f3f4f6; color: #6b7280; }
.tag-following { background: #dbeafe; color: #1d4ed8; }
.tag-decorating { background: #fef9c3; color: #a16207; }
.tag-appeal { background: #f3e8ff; color: #7e22ce; }

/* ---------- 地图 ---------- */
#mapChart { width: 100%; height: 620px; }
.map-hint { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.province-panel {
  position: fixed; top: 0; right: 0; width: 440px; height: 100vh; background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.15); z-index: 100; transform: translateX(100%);
  transition: transform .25s; display: flex; flex-direction: column;
}
.province-panel.open { transform: translateX(0); }
.province-panel .head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.province-panel .head h3 { font-size: 16px; }
.province-panel .body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.province-panel .city-group { margin-bottom: 18px; }
.province-panel .city-group h4 { font-size: 14px; color: var(--primary); margin-bottom: 8px; }
.province-panel .store-row { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.province-panel .store-row .nm { font-weight: 500; }
.province-panel .store-row .meta { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 99; opacity: 0; pointer-events: none; transition: opacity .25s; }
.mask.show { opacity: 1; pointer-events: auto; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: none; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 92vw; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal h3 { font-size: 17px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row.full { grid-template-columns: 1fr; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-item label .req { color: var(--red); }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 60px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-2); padding: 60px 0; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300;
  background: #111827; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* ---------- 移动端响应式 ---------- */
@media (max-width: 768px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 8px 12px; overflow: hidden; }
  .sidebar .logo { padding: 0 12px 0 0; border-bottom: none; font-size: 15px; flex-shrink: 0; }
  .sidebar .logo span { display: none; }
  .nav { display: flex; flex-direction: row; overflow-x: auto; padding: 0; gap: 2px; flex: 1; }
  .nav-item { padding: 8px 12px; white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: none; border-bottom-color: var(--primary); }
  .nav-item .ic { display: none; }
  .sidebar .foot { display: none; }
  .main { width: 100%; }
  .topbar { height: 48px; padding: 0 12px; }
  .topbar h2 { font-size: 15px; }
  .topbar .user-chip { display: none; }
  .content { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .toolbar input { flex: 1 1 40%; min-width: 0; }
  .toolbar select { flex: 1 1 40%; min-width: 0; }
  .toolbar .spacer { display: none; }
  .modal { width: 94vw; padding: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .province-panel { width: 100%; }
  .card { padding: 14px; }
  .login-card { width: 92vw; padding: 30px 22px; }
  .login-logo img { height: 46px; }
}

/* ---------- 待审核详情 / 查重 ---------- */
.detail-body { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.detail-row { display: flex; border-bottom: 1px dashed var(--border); padding: 6px 0; }
.detail-row .dl { width: 110px; flex-shrink: 0; color: var(--text-2); font-size: 13px; }
.detail-row .dv { flex: 1; word-break: break-all; }
.dup-box { background: #fefce8; border: 1px solid #fde68a; border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.dup-title { font-weight: 600; margin-bottom: 8px; color: #a16207; }
.dup-item { background: #fff; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.dup-name { margin-bottom: 2px; }
.dup-sub { color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
.dup-match { font-size: 12px; color: #b45309; }
.dup-match .tag { margin-left: 4px; }

