/* 曼巴线报后台 · 设计变量 */
:root {
  --bg: #F5F8F1;
  --card: #FFFFFF;
  --ink: #12210A;
  --ink-2: #2B3A22;
  --sub: #6B7A63;
  --hint: #9AA59A;
  --line: #E7EEE0;
  --line-2: #DCE5D2;
  --green: #7ED321;
  --green-d: #5FA812;
  --green-soft: #EEFADF;
  --amber: #F5A524;
  --brown: #A9722F;
  --purple: #8B5CF6;
  --red: #E5484D;
  --red-soft: #FCEDED;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 0 var(--ink);
  --shadow-sm: 0 4px 0 var(--ink);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

.input, select.input, textarea.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 2px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

textarea.input {
  height: auto;
  padding: 10px 14px;
  line-height: 1.6;
  resize: vertical;
}

.input:focus {
  border-color: var(--ink);
}

.input::placeholder { color: var(--hint); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--green);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform .1s, box-shadow .1s;
}

.btn-primary:hover { background: #8AE02F; }

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-primary:disabled {
  background: #E4EADB;
  color: var(--hint);
  border-color: var(--line-2);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 2px solid var(--line-2);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.btn-ghost:hover { border-color: var(--ink); }

.btn-danger {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.btn-danger:hover { background: #FADDDD; }

/* ---------- 登录页 ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 18%, #EDFADF 0, transparent 42%),
    radial-gradient(circle at 88% 82%, #E7F6D6 0, transparent 46%),
    var(--bg);
  padding: 24px;
}

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 34px 30px 26px;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin-right: 14px;
}

.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.brand-sub { font-size: 12px; color: var(--hint); margin-top: 3px; letter-spacing: 1px; }

.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 7px;
  letter-spacing: .5px;
}

.login-card .btn-primary { width: 100%; margin-top: 6px; }

.err {
  min-height: 18px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 6px;
}

.login-tip { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.login-tip .btn-ghost { width: 100%; }
.login-tip .hint { font-size: 11px; color: var(--hint); margin-top: 8px; line-height: 1.6; }

.login-foot {
  text-align: center;
  font-size: 11px;
  color: var(--hint);
  margin-top: 22px;
}

/* ---------- 后台布局 ---------- */

.app {
  display: flex;
  min-height: 100vh;
}

.side {
  width: 216px;
  flex-shrink: 0;
  background: #fff;
  border-right: 3px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
}

.side-brand {
  display: flex;
  align-items: center;
  padding: 20px 18px;
  border-bottom: 2px solid var(--line);
}

.side-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--green);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  margin-right: 10px;
}

.side-title { font-size: 15px; font-weight: 800; }
.side-sub { font-size: 11px; color: var(--hint); margin-top: 2px; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}

.nav-item:hover { background: #F6F9F2; color: var(--ink); }

.nav-item.active {
  background: var(--green-soft);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.nav-ico {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}

.side-foot {
  padding: 14px 18px 18px;
  border-top: 2px solid var(--line);
}

.side-user { font-size: 12px; color: var(--sub); margin-bottom: 10px; }
.side-user b { color: var(--ink); }

.main {
  flex: 1;
  margin-left: 216px;
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: rgba(245, 248, 241, .92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--line);
}

.page-title { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.page-desc { font-size: 12px; color: var(--hint); margin-top: 2px; }

.content { padding: 24px 26px 60px; }

.card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card.flat {
  border-width: 2px;
  border-color: var(--line-2);
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 15px; font-weight: 800; }
.card-sub { font-size: 12px; color: var(--hint); margin-top: 3px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.kpi-label { font-size: 12px; color: var(--hint); font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -1px; line-height: 1.1; }
.kpi-delta { font-size: 12px; color: var(--green-d); margin-top: 6px; font-weight: 600; }

.table-wrap { overflow-x: auto; }

table.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.tb th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  letter-spacing: .5px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

table.tb td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.tb tr:last-child td { border-bottom: none; }
table.tb tr:hover td { background: #FBFDF8; }

.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.pill.green { background: var(--green-soft); color: var(--green-d); }
.pill.gray { background: #F1F4EE; color: var(--hint); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: #FEF4E4; color: #9A6206; }
.pill.blue { background: #EEF2FE; color: #3B5BDB; }

.act {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  margin-right: 6px;
  white-space: nowrap;
}

.act:hover { border-color: var(--ink); }
.act.danger { color: var(--red); border-color: #F3D4D4; }
.act.danger:hover { border-color: var(--red); background: var(--red-soft); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .input { width: auto; min-width: 160px; }
.toolbar select.input { min-width: 120px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12px;
  color: var(--sub);
}

.pager-btns { display: flex; gap: 8px; }

.empty {
  padding: 50px 0;
  text-align: center;
  color: var(--hint);
  font-size: 13px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 160px;
  padding-top: 10px;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.chart-bar { width: 14px; border-radius: 4px 4px 0 0; min-height: 3px; }
.chart-bar.a { background: var(--green); }
.chart-bar.b { background: var(--ink); }
.chart-label { font-size: 11px; color: var(--hint); margin-top: 8px; }

.legend { display: flex; gap: 16px; font-size: 11px; color: var(--sub); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle span {
  position: absolute;
  inset: 0;
  background: #DDE5D4;
  border-radius: 13px;
  transition: .2s;
  border: 2px solid var(--ink);
}

.toggle span::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  border: 2px solid var(--ink);
}

.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::before { transform: translateX(20px); }

.form-row { margin-bottom: 16px; }
.form-row .field-label { margin-bottom: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.hint-block {
  font-size: 12px;
  color: var(--hint);
  line-height: 1.7;
  background: #FAFCF7;
  border: 2px dashed var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
}

/* ---------- 车队管理 / 举报反馈 ---------- */

.tdots { display: flex; gap: 4px; align-items: center; }
.tdots .tdot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: #fff; display: inline-block;
}
.tdots .tdot.on { background: var(--green); border-color: var(--green); }
.tdots .tdot.hold { background: #FFC93C; border-color: #E3A81E; }

.detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 14px;
}
.detail-item {
  background: #FAFCF7; border: 2px solid var(--line-2);
  border-radius: 12px; padding: 10px 12px; min-width: 0;
}
.detail-label { font-size: 11px; color: var(--hint); margin-bottom: 5px; white-space: nowrap; }
.detail-value { font-size: 13px; font-weight: 700; word-break: break-all; }
/* 弹层里的胶囊/身份标签不能被压成竖排 */
#modalRoot .pill { white-space: nowrap; }
/* 弹层内容比表格页更需要横向空间，收紧单行高度、放开列宽 */
#modalRoot .modal { max-width: 860px; }
#modalRoot .tb th,
#modalRoot .tb td { white-space: nowrap; }
#modalRoot .mini-row > span:nth-child(3) { white-space: normal; }

.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid #EDF1E8;
}
.mini-row:last-child { border-bottom: none; }

.mono-block {
  font-family: var(--mono); font-size: 12px; word-break: break-all;
  background: #FAFCF7; border: 2px dashed var(--line-2);
  border-radius: 10px; padding: 9px 12px; color: #2B3A22;
}

.shot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.shot-grid.sm { margin-top: 10px; }
.shot-img {
  width: 92px; height: 92px; object-fit: cover;
  border-radius: 10px; border: 2px solid var(--line-2);
  background: #fff; display: block;
}
.shot-grid.sm .shot-img { width: 76px; height: 76px; }

.report-body { padding-top: 4px; }
.report-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 12px; font-size: 12px; color: var(--hint);
}
.note-block {
  margin-top: 10px; font-size: 12px; color: #9A6206;
  background: #FEF4E4; border-radius: 10px; padding: 9px 12px;
}

.tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.tabs .tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700;
  border: 2px solid var(--line-2); background: #fff; cursor: pointer;
  color: #6B7A63; transition: .18s; user-select: none;
}
.tabs .tab:hover { border-color: var(--ink); }
.tabs .tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs .tab b {
  font-size: 11px; font-weight: 800; background: var(--red); color: #fff;
  border-radius: 10px; padding: 1px 6px; line-height: 1.5;
}
.tabs .tab.active b { background: var(--green); color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 999;
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 33, 10, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; font-size: 16px; line-height: 1; color: var(--sub); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.qr-box {
  width: 150px;
  height: 150px;
  border: 2px dashed var(--line-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 12px;
  background: #FAFCF7;
  overflow: hidden;
}

.qr-box img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 900px) {
  .side { width: 62px; }
  .side-title, .side-sub, .nav-item span, .side-user { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-ico { margin-right: 0; }
  .main { margin-left: 62px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 16px; }
}
