/* ==================================================================
   新上洗车 · 运营后台样式（白色底 + 蓝青科技风，与小程序端同一套色板）
   ================================================================== */
:root {
  --bg: #f5f9ff;
  --card: #ffffff;
  --line: rgba(43, 124, 255, 0.14);
  --line-strong: rgba(43, 124, 255, 0.34);
  --text: #0d1b2f;
  --sub: #5b6b84;
  --muted: #9aa8bb;
  --brand: #2b7cff;
  --brand-deep: #1f6fe0;
  --cyan: #0fb5d8;
  --ok: #0f8f65;
  --warn: #c97a00;
  --danger: #e5404f;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(31, 94, 204, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(43, 124, 255, 0.1), transparent 70%),
    radial-gradient(760px 440px at 104% 2%, rgba(15, 181, 216, 0.1), transparent 70%),
    repeating-linear-gradient(0deg, rgba(43, 124, 255, 0.05) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(43, 124, 255, 0.05) 0 1px, transparent 1px 48px);
  font-size: 14px;
  line-height: 1.55;
}
a {
  color: var(--brand-deep);
  text-decoration: none;
}
button {
  font-family: inherit;
}

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 18px 50px rgba(31, 94, 204, 0.14);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2b7cff, #0fb5d8, #2b7cff);
}
.brand-tag {
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(31, 111, 224, 0.6);
  text-align: center;
}
.login-title {
  margin: 10px 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}
.login-sub {
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--sub);
  text-align: center;
}
.login-card .field {
  margin-bottom: 14px;
}
.login-hint {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f8ff;
  border: 1px solid rgba(43, 124, 255, 0.2);
  color: var(--sub);
  font-size: 12px;
  text-align: center;
}

/* ---------------- 主框架 ---------------- */
.shell {
  display: grid;
  grid-template-columns: 228px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3d8bfd, #1f6fe0 60%, #0fb5d8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(43, 124, 255, 0.32);
}
.logo-text b {
  display: block;
  font-size: 15px;
  letter-spacing: 1px;
}
.logo-text span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sub);
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 14px;
  transition: 0.15s;
}
.nav-item:hover {
  background: #f3f8ff;
  color: var(--text);
}
.nav-item.active {
  background: #eef6ff;
  border-color: rgba(43, 124, 255, 0.3);
  color: var(--brand-deep);
  font-weight: 600;
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.nav-item.active .nav-dot {
  opacity: 1;
  box-shadow: 0 0 8px rgba(43, 124, 255, 0.7);
}
.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  line-height: 1.7;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.page-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--sub);
}
.content {
  padding: 22px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  position: relative;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--cyan));
  vertical-align: -2px;
}
.card-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1px solid rgba(43, 124, 255, 0.16);
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  margin-left: 4px;
}
.kpi-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--sub);
}
.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}
@media (max-width: 1080px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .logo {
    padding: 4px 8px;
  }
  .sidebar-foot {
    display: none;
  }
}

/* ---------------- 图表 ---------------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  padding-top: 10px;
}
.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 26px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #3d8bfd, #0fb5d8);
  min-height: 2px;
  transition: 0.2s;
  position: relative;
}
.bar:hover {
  filter: brightness(1.08);
}
.bar-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  transform: scale(0.92);
}
.hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
}
.hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  height: 100%;
}
.hour-bar {
  width: 100%;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, #7bd7ef, #2b7cff);
  min-height: 2px;
}
.hour-label {
  font-size: 9px;
  color: var(--muted);
  transform: scale(0.85);
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--sub);
  margin-top: 10px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

/* ---------------- 列表/进度条 ---------------- */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rank-item {
  font-size: 13px;
}
.rank-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.rank-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-value {
  color: var(--sub);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.progress {
  height: 7px;
  border-radius: 999px;
  background: #eef3fb;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b7cff, #0fb5d8);
}

/* ---------------- 表格 ---------------- */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
thead th {
  position: sticky;
  top: 0;
  background: #f6faff;
  color: var(--sub);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 1;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(43, 124, 255, 0.08);
  vertical-align: middle;
}
tbody tr:hover td {
  background: #fafdff;
}
tbody tr:last-child td {
  border-bottom: none;
}
.num {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.sub {
  color: var(--sub);
}
.ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-blue {
  color: var(--brand-deep);
  background: #eef6ff;
  border-color: rgba(43, 124, 255, 0.24);
}
.badge-ok {
  color: var(--ok);
  background: #e9f9f2;
  border-color: rgba(15, 143, 101, 0.24);
}
.badge-warn {
  color: var(--warn);
  background: #fff6e6;
  border-color: rgba(201, 122, 0, 0.24);
}
.badge-danger {
  color: #c33a46;
  background: #fdeeee;
  border-color: rgba(229, 64, 79, 0.24);
}
.badge-gray {
  color: var(--sub);
  background: #f3f6fa;
  border-color: rgba(91, 107, 132, 0.18);
}

/* ---------------- 表单控件 ---------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label {
  font-size: 12px;
  color: var(--sub);
  letter-spacing: 0.5px;
}
input[type='text'],
input[type='password'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(43, 124, 255, 0.22);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 124, 255, 0.12);
}
textarea {
  min-height: 130px;
  resize: vertical;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(43, 124, 255, 0.22);
  background: #f5f9ff;
  color: #22344e;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.btn:hover {
  border-color: rgba(43, 124, 255, 0.45);
  background: #eef6ff;
}
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #3d8bfd, #1f6fe0 60%, #0fb5d8);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(43, 124, 255, 0.26);
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-danger {
  border-color: rgba(229, 64, 79, 0.3);
  background: #fdeeee;
  color: #c33a46;
}
.btn-ghost {
  background: #fff;
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------- 提示/空态 ---------------- */
.hint {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid rgba(43, 124, 255, 0.18);
  background: #f4f9ff;
  color: var(--sub);
}
.hint-warn {
  border-color: rgba(201, 122, 0, 0.24);
  background: #fff8ec;
  color: #a86a00;
}
.hint-danger {
  border-color: rgba(229, 64, 79, 0.22);
  background: #fdf3f4;
  color: #a8404a;
}
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 12px;
  color: var(--sub);
}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 47, 0.4);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(13, 27, 47, 0.24);
  overflow: hidden;
}
.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
}
.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
}
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------------- Toast ---------------- */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(13, 27, 47, 0.16);
  font-size: 13px;
  color: var(--text);
  animation: toast-in 0.18s ease-out;
}
.toast.ok {
  border-color: rgba(15, 143, 101, 0.3);
  color: var(--ok);
}
.toast.err {
  border-color: rgba(229, 64, 79, 0.3);
  color: #c33a46;
}
@keyframes toast-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ---------------- 杂项 ---------------- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.small {
  font-size: 12px;
}
.chart-title {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.kv-list .k {
  color: var(--sub);
  display: inline-block;
  min-width: 108px;
}
code {
  background: #f1f6fd;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
}
