/* 云照后台 · 与官网品牌一致的商务后台样式 */
:root {
  --brand-50: #eef8ff;
  --brand-100: #d9f0ff;
  --brand-200: #bce5ff;
  --brand-400: #4fb8ff;
  --brand-500: #00acff;
  --brand-600: #0088e8;
  --brand-700: #006cc0;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: linear-gradient(105deg, #0c1a28 0%, #0f2744 55%, #0a3a5c 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #00acff 50%, #818cf8);
  box-shadow: 0 4px 12px rgba(0, 172, 255, 0.35);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
}
.topbar-title { font-weight: 700; font-size: 1rem; letter-spacing: 0.02em; }
.topbar-sub { font-size: 0.78rem; color: #94a3b8; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-user {
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(255,255,255,.08);
  padding: 6px 12px;
  border-radius: 999px;
}
.topbar a.btn-ghost {
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  transition: .15s ease;
}
.topbar a.btn-ghost:hover {
  background: rgba(0, 172, 255, 0.18);
  border-color: rgba(0, 172, 255, 0.35);
  color: #fff;
}

/* —— Layout —— */
.shell { max-width: 1180px; margin: 0 auto; padding: 22px 18px 48px; }

/* —— Stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -12px;
  top: -12px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,172,255,.12), transparent 70%);
}
.stat .label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 1.65rem; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.stat .value.brand { color: var(--brand-600); }
.stat .value.warn { color: var(--warn); }
.stat .hint { font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }

/* —— Toolbar —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
  transition: .15s ease;
}
.filters a:hover { border-color: var(--brand-200); color: var(--brand-700); }
.filters a.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 136, 232, 0.28);
}
.filters a .count {
  font-size: 0.72rem;
  opacity: 0.85;
  background: rgba(15,23,42,.06);
  padding: 1px 7px;
  border-radius: 999px;
}
.filters a.active .count { background: rgba(255,255,255,.22); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  min-width: min(100%, 280px);
  box-shadow: var(--shadow);
}
.search-box input {
  border: 0;
  outline: 0;
  flex: 1;
  font-size: 0.88rem;
  background: transparent;
  min-width: 0;
}
.search-box button {
  border: 0;
  border-radius: 999px;
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 14px;
  cursor: pointer;
}
.search-box button:hover { background: var(--brand-600); }

/* —— Lead cards —— */
.leads { display: flex; flex-direction: column; gap: 12px; }
.lead {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lead:hover { border-color: #cbd5e1; box-shadow: 0 8px 28px rgba(15,23,42,.08); }
.lead.is-unread {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 40%, #fff 100%);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.12), var(--shadow);
  cursor: pointer;
}
.lead.is-unread:hover {
  border-color: #38bdf8;
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.15);
}
.lead.is-unread .lead-msg {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.lead:not(.is-unread) {
  cursor: default;
}
.lead-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.lead-person strong { font-size: 1rem; }
.lead-person .contact { margin-top: 4px; font-size: 0.86rem; color: #334155; }
.lead-person .meta { margin-top: 3px; font-size: 0.75rem; color: #94a3b8; }
.lead-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge.u { background: #dbeafe; color: #1d4ed8; }
.badge.r { background: #f1f5f9; color: #64748b; }
.badge.t { background: #ecfeff; color: #0e7490; }

.lead-body {
  padding: 0 16px 12px;
}
.lead-msg {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 12px 14px;
}
.lead-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f5f9;
}
.lead-foot .meta { font-size: 0.74rem; color: #94a3b8; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
form.inline { display: inline; margin: 0; }
.btn {
  border: 0;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: .12s ease;
}
.btn-read { background: #e0f2fe; color: #0369a1; }
.btn-read:hover { background: #bae6fd; }
.btn-unread { background: #f1f5f9; color: #475569; }
.btn-unread:hover { background: #e2e8f0; }
.btn-del { background: var(--danger-bg); color: #b91c1c; }
.btn-del:hover { background: #fecaca; }
.btn-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 9px;
  background: #f0f9ff;
  color: var(--brand-700);
  font-size: 0.78rem;
  font-weight: 600;
}
.btn-link:hover { background: #e0f2fe; }

.empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--card);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--muted);
}
.empty h3 { margin: 0 0 8px; color: var(--ink); font-size: 1.05rem; }
.empty p { margin: 0; font-size: 0.9rem; line-height: 1.6; }

/* —— Login page —— */
body.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(0,172,255,.28), transparent 55%),
    radial-gradient(700px 400px at 100% 100%, rgba(129,140,248,.22), transparent 50%),
    linear-gradient(160deg, #0c1a28 0%, #0f2744 50%, #0b1f33 100%);
  color: #e2e8f0;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-brand {
  text-align: center;
  margin-bottom: 20px;
}
.login-brand .mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #22d3ee, #00acff 55%, #818cf8);
  box-shadow: 0 12px 30px rgba(0,172,255,.35);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
}
.login-brand p {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #94a3b8;
}
.login-card {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 48px rgba(0,0,0,.35);
}
.login-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 14px 0 7px;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #f8fafc;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0,172,255,.18);
}
.login-card button[type="submit"] {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,136,232,.32);
}
.login-card button[type="submit"]:hover {
  filter: brightness(1.05);
}
.login-card button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}
.err {
  background: rgba(127, 29, 29, 0.55);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 4px;
  line-height: 1.45;
}
.login-tip {
  margin: 16px 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.55;
  text-align: center;
}
.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
}
.login-foot a { color: #7dd3fc; }

/* ── 商城模块：顶栏导航 / 卡片 / 表格 / 状态标签 ───────────────── */

.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-nav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,.72);
  transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar-nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }

.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.notice-ok { background: var(--ok-bg); color: var(--ok); border-color: #a7f3d0; }
.notice-err { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-weight: 700; font-size: 1rem; color: var(--ink); }
.card-sub { margin-top: 4px; font-size: 0.84rem; color: var(--muted); }
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.card-actions form { display: flex; align-items: center; gap: 8px; margin: 0; }

.subcard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  background: #fbfdff;
}
.subcard .card-actions { margin-top: 12px; padding-top: 10px; }

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 24px;
  margin: 16px 0 0;
}
.kv > div { display: flex; flex-direction: column; gap: 3px; }
.kv dt { font-size: 0.76rem; color: var(--muted); }
.kv dd { margin: 0; font-size: 0.9rem; color: var(--ink); word-break: break-all; }
.kv dd.amount { font-weight: 700; color: var(--brand-700); }

.msg {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.amount { font-weight: 700; color: var(--brand-700); }
.cell-sub { margin-top: 3px; font-size: 0.78rem; color: var(--muted); }
.hint-line { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }
.hint-warn { color: var(--warn); font-weight: 500; }

.tag {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.76rem;
}

.pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-pending { background: var(--warn-bg); color: var(--warn); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-err { background: var(--danger-bg); color: var(--danger); }
.pill-brand { background: var(--brand-50); color: var(--brand-700); }
.pill-muted { background: #f1f5f9; color: var(--muted); }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbfdff; }

.inline-input {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.85rem;
  font-family: inherit;
  min-width: 180px;
}
.inline-input:focus { outline: none; border-color: var(--brand-400); }

.btn-ghost {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--brand-200); color: var(--brand-700); }

.btn-primary {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--brand-600);
  border-radius: 9px;
  background: var(--brand-500);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-600); }

/* 临时密码展示（仅显示一次） */
.temp-pass {
  margin: 12px 0 0;
  padding: 14px 18px;
  border: 1px dashed var(--brand-400);
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  user-select: all;
}

/* 表格行内的多个操作按钮 */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
