/* ============================================================
   中联交通 CMS · 后台样式
   ============================================================ */

:root {
  --ink: #0a1826;
  --ink-2: #14283c;
  --red: #c1121f;
  --red-2: #a00e19;
  --line: #e3e8ed;
  --line-2: #eef2f5;
  --fog: #f5f7f9;
  --fog-2: #eef2f5;
  --text: #1b2a38;
  --muted: #6b7a88;
  --muted-2: #97a4b0;
  --ok: #17936c;
  --warn: #b8770f;
  --shadow: 0 1px 2px rgba(10, 24, 38, .04), 0 8px 24px -12px rgba(10, 24, 38, .12);
  --radius: 4px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--fog);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 226px;
  flex: none;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 20;
}

.side-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.side-brand b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
}
.side-brand span {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  letter-spacing: .18em;
  color: rgba(255, 255, 255, .42);
}

.side-nav { flex: 1; padding: 16px 0 24px; }
.side-group { margin-bottom: 6px; }
.side-group > p {
  margin: 16px 22px 8px;
  font-size: 11px;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .34);
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px 9px 24px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .72);
  border-left: 2px solid transparent;
  transition: all .22s var(--ease);
}
.side-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .05);
}
.side-nav a.on {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border-left-color: var(--red);
  font-weight: 600;
}
.side-nav a .dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.side-foot {
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  color: rgba(255, 255, 255, .42);
}
.side-foot a { color: rgba(255, 255, 255, .62); }
.side-foot a:hover { color: #fff; }

.main {
  flex: 1;
  margin-left: 226px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}
.topbar .tb-sub { margin-left: 12px; font-size: 12.5px; color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.topbar-right .who { color: var(--muted); }
.topbar-right .who b { color: var(--text); font-weight: 600; }

.page { padding: 26px 28px 60px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.card-head .ch-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted-2);
}
.card-body { padding: 22px; }
.card-body--flush { padding: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: all .22s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--ink-2); }
.btn--red { background: var(--red); }
.btn--red:hover { background: var(--red-2); }
.btn--line {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}
.btn--line:hover { border-color: var(--muted-2); background: var(--fog); }
.btn--sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn--danger { background: #fff; border-color: #e5c5c8; color: var(--red); }
.btn--danger:hover { background: #fdf3f4; border-color: var(--red); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.tb th {
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--fog);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tb td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tb tr:last-child td { border-bottom: 0; }
table.tb tbody tr:hover { background: #fafbfc; }
table.tb .col-act { text-align: right; white-space: nowrap; }
table.tb .col-img { width: 72px; }
table.tb .col-img img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--fog);
}
table.tb .t-title {
  font-weight: 500;
  color: var(--text);
  display: block;
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.tb .t-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted-2);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-act {
  display: inline-flex;
  gap: 4px;
  opacity: .55;
  transition: opacity .2s;
}
tr:hover .t-act { opacity: 1; }
.t-act a, .t-act button {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  font-size: 12.5px;
  color: var(--muted);
}
.t-act a:hover, .t-act button:hover { color: var(--ink); border-color: var(--muted-2); }
.t-act .del:hover { color: var(--red); border-color: #e5c5c8; }

/* ---------------- 状态药丸 ---------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--fog-2);
  color: var(--muted);
  border: 0;
}
.pill i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill--on { background: #eaf6f1; color: var(--ok); }
.pill--off { background: #f2f4f6; color: var(--muted-2); }
.pill--new { background: #fdf1f2; color: var(--red); }

/* ---------------- 搜索栏 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.field-inline {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.field-inline:focus { border-color: var(--muted); }
.field-inline::placeholder { color: var(--muted-2); }
select.field-inline { padding-right: 30px; cursor: pointer; }

/* ---------------- 表单 ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px 22px;
}
.fm { grid-column: span 12; }
.fm-6 { grid-column: span 6; }
.fm-4 { grid-column: span 4; }
.fm-3 { grid-column: span 3; }
.fm > label, .fm-6 > label, .fm-4 > label, .fm-3 > label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.fm > label em, .fm-6 > label em, .fm-4 > label em, .fm-3 > label em {
  color: var(--red);
  font-style: normal;
  margin-left: 3px;
}
.inp {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.inp:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 24, 38, .05);
}
textarea.inp {
  height: auto;
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.7;
  resize: vertical;
}
select.inp { cursor: pointer; }
.tip {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.6;
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  height: 40px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #d6dde3;
  position: relative;
  transition: background .24s var(--ease);
  flex: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .24s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch span { font-size: 13px; color: var(--muted); }

/* 图片上传 */
.uploader {
  width: 148px;
  height: 148px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: var(--fog);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.uploader:hover { border-color: var(--muted-2); }
.uploader img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.uploader .up-empty {
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.7;
}
.uploader .up-empty b {
  display: block;
  font-size: 22px;
  font-weight: 300;
  margin-bottom: 2px;
}
.uploader .up-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 38, .62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 12.5px;
  opacity: 0;
  transition: opacity .2s;
}
.uploader:hover .up-mask { opacity: 1; }
.uploader .up-mask a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.uploader input[type=file] { display: none; }
.uploader.is-wide { width: 100%; height: 200px; }

/* 图集 */
.gallery-list { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-list .gi {
  width: 96px; height: 96px;
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}
.gallery-list .gi img { width: 100%; height: 100%; object-fit: cover; }
.gallery-list .gi button {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 24, 38, .68);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  padding: 0;
}

/* 富文本 */
.editor {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 7px 8px;
  background: var(--fog);
  border-bottom: 1px solid var(--line);
}
.editor-bar button {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  transition: all .16s;
}
.editor-bar button:hover { background: #fff; color: var(--ink); }
.editor-bar button.on { background: var(--ink); color: #fff; }
.editor-bar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 5px; }
.editor-body {
  min-height: 260px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px 18px;
  background: #fff;
  outline: none;
  line-height: 1.85;
  font-size: 14px;
}
.editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted-2);
}
.editor-body h2 { font-size: 20px; margin: 18px 0 10px; }
.editor-body h3 { font-size: 17px; margin: 16px 0 8px; }
.editor-body p { margin: 0 0 12px; }
.editor-body img { max-width: 100%; height: auto; margin: 10px 0; }
.editor-body blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--red);
  background: var(--fog);
  color: var(--muted);
}
.editor-body ul, .editor-body ol { padding-left: 22px; margin: 0 0 12px; }

/* 表单底栏 */
.form-foot {
  position: sticky;
  bottom: 0;
  margin-top: 20px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(6px);
  z-index: 10;
}
.form-foot .hint { font-size: 12.5px; color: var(--muted-2); margin-right: auto; }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--ink);
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: #fff;
}
.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .38;
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 24, 38, .35), rgba(10, 24, 38, .92));
}
.login-visual > div { position: relative; z-index: 2; }
.login-visual h2 {
  font-size: 30px;
  line-height: 1.4;
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.login-visual p { margin: 0; color: rgba(255, 255, 255, .62); font-size: 14px; max-width: 420px; }
.login-visual .lg-mark {
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .5);
  margin-bottom: 22px;
}

.login-form-wrap {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form { width: 100%; max-width: 340px; }
.login-form h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}
.login-form .sub { margin: 0 0 32px; font-size: 13px; color: var(--muted-2); }
.login-form .fm { margin-bottom: 18px; }
.login-form .btn { width: 100%; height: 44px; margin-top: 8px; }
.login-err {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fdf3f4;
  border-left: 2px solid var(--red);
  color: var(--red);
  font-size: 12.5px;
  display: none;
}
.login-foot { margin-top: 28px; font-size: 12px; color: var(--muted-2); text-align: center; }

/* ---------------- 仪表盘 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card span {
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: .08em;
}
.stat-card b {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.stat-card em {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted-2);
}
.stat-card--alert b { color: var(--red); }

.two-col {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: start;
}

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ml-main { flex: 1; min-width: 0; }
.mini-list .ml-main b {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-list .ml-main span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-list time {
  font-size: 12px;
  color: var(--muted-2);
  flex: none;
  font-variant-numeric: tabular-nums;
}
.empty {
  padding: 46px 22px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  background: #fdf8ec;
  border: 1px solid #f2e3c0;
  border-radius: 3px;
  font-size: 13px;
  color: #8a6414;
  margin-bottom: 18px;
}
.notice b { font-weight: 600; }
.notice a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.notice--ok { background: #eef8f3; border-color: #cfe9dd; color: #1a6d52; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}
.pager .pl { display: flex; gap: 5px; }
.pager a, .pager span {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
}
.pager a:hover { border-color: var(--muted-2); color: var(--ink); }
.pager .active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.pager .disabled { opacity: .4; }

/* ---------------- Toast ---------------- */
.toast-box {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 20px;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 10px 30px -8px rgba(10, 24, 38, .4);
  animation: toastIn .28s var(--ease);
  max-width: 80vw;
}
.toast--err { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 分段设置导航 ---------------- */
.set-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  background: #fff;
  overflow-x: auto;
}
.set-tabs a {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.set-tabs a:hover { color: var(--ink); }
.set-tabs a.on {
  color: var(--ink);
  border-bottom-color: var(--red);
  font-weight: 600;
}
.set-group { display: none; }
.set-group.on { display: block; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
@media (max-width: 860px) {
  .side {
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
  }
  .side.open { transform: none; }
  .main { margin-left: 0; }
  .page { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .fm, .fm-6, .fm-4, .fm-3 { grid-column: span 12; }
  .card-body { padding: 16px; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  margin-right: 12px;
}


/* ---------------- 分页（框架渲染） ---------------- */
.pagination {
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.pagination li { display: inline-flex; }
.pagination li a,
.pagination li span {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.pagination li a:hover { border-color: var(--muted-2); color: var(--ink); }
.pagination li.active span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.pagination li.disabled span {
  opacity: .42;
}
.pager .pl { overflow-x: auto; }
