/* 门店数据管理页 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  padding-bottom: 40px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: #10b981;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.stats {
  display: flex;
  gap: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 6px 16px;
}
.stats b { font-size: 15px; }
.c-ours b { color: #fde8e8; }
.c-other b { color: #d9f7e6; }
.back {
  margin-left: auto;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, .18);
  padding: 6px 14px;
  border-radius: 999px;
}
.back:hover { background: rgba(255, 255, 255, .3); }
#btn-logout { border: none; cursor: pointer; }

/* ---------- 登录视图（未登录时只显示登录卡片） ---------- */
body:not(.authed) .topbar,
body:not(.authed) .wrap { display: none; }
body.authed #login-view { display: none; }
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  width: 340px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .12);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.login-card h2 { font-size: 19px; }
.login-card input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  text-align: center;
}
.login-card input:focus { border-color: #10b981; }
.login-err { color: #dc2626; font-size: 13px; min-height: 18px; }
.login-card .btn { width: 100%; padding: 11px 0; }
.login-links {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 4px;
}
.login-links a { color: #2563eb; text-decoration: none; }

/* ---------- 主体 ---------- */
.wrap {
  max-width: 960px;
  margin: 16px auto;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.tip {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ---------- 品牌管理 ---------- */
.brand-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.brand-add input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.brand-add input:focus { border-color: #10b981; }
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: #10b981;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 14px;
}
.brand-tag button {
  border: none;
  background: none;
  color: #10b981;
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.brand-tag button:hover { color: #ef4444; }

/* ---------- 门店列表 ---------- */
#search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}
#search:focus { border-color: #10b981; }
.table-box { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
th {
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
  background: #f8fafc;
  position: sticky;
  top: 0;
}
td.name { white-space: normal; min-width: 180px; font-weight: 500; }
td.coord { color: #94a3b8; font-size: 12px; }
tr:hover td { background: #f8fafc; }

td select {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  outline: none;
  cursor: pointer;
}
td select:focus { border-color: #10b981; }
select.type-ours { color: #dc2626; font-weight: 600; }
select.type-other { color: #16a34a; }

.btn-del {
  padding: 5px 12px;
  border: none;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 13px;
  cursor: pointer;
}
.btn-del:hover { background: #fecaca; }

/* ---------- Toast（微信风格，居中） ---------- */
#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  z-index: 500;
  background: rgba(17, 24, 39, .85);
  color: #fff;
  font-size: 15px;
  padding: 18px 22px;
  border-radius: 12px;
  max-width: 70vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
