/* ============================================
   瑞准云车牌管理平台 - 现代化 UI 样式 v2.0
   科技蓝 · 圆角卡片 · 微动效 · 响应式
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #e11d48;
  --ink: #1e293b;
  --text: #334155;
  --muted: #94a3b8;
  --line: #e8edf3;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 20px rgba(15,23,42,.05);
  --shadow-hover: 0 10px 30px rgba(37,99,235,.12);
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }

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

/* 侧边栏 */
.sidebar {
  width: 232px;
  background: linear-gradient(165deg, #0f2745 0%, #0b1e38 55%, #0a1a30 100%);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: -80px; left: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(37,99,235,.35), transparent 68%);
  pointer-events: none;
}
.sidebar-logo {
  padding: 22px 20px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  letter-spacing: .5px;
}
.logo-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(14,165,233,.4);
  flex-shrink: 0;
}
.logo-sub { display: block; font-size: 11px; font-weight: 400; color: #7c98bf; letter-spacing: 1px; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 16px 12px; position: relative; }
.nav-label { font-size: 11px; color: #5b7a9f; padding: 0 12px 8px; letter-spacing: 1.5px; text-transform: uppercase; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 5px;
  color: #a7bdd6;
  border-radius: 10px;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}
.sidebar nav a .nav-ico {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  filter: grayscale(.3);
  transition: var(--transition);
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.sidebar nav a:hover .nav-ico { filter: none; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(37,99,235,.95), rgba(37,99,235,.55));
  color: #fff;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
}
.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 24px;
  background: #60a5fa;
  border-radius: 0 3px 3px 0;
}
.sidebar nav a.active .nav-ico { filter: none; }
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { display: block; color: #f1f5f9; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: #7c98bf; }
.logout-link { color: #94a3b8; font-size: 12px; padding: 6px 10px; border-radius: 7px; transition: var(--transition); }
.logout-link:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 680; color: var(--ink); display: flex; align-items: center; gap: 11px; }
.topbar-title::before {
  content: '';
  width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 3px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.topbar-date { display: flex; align-items: center; gap: 6px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.15); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }
.content { padding: 26px 28px 40px; flex: 1; }

/* ========== 数据卡片 ========== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 22px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(226,232,240,.6);
}
.card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  background: radial-gradient(circle at top right, var(--card-tint, rgba(37,99,235,.1)), transparent 70%);
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.card-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.card-num { font-size: 30px; font-weight: 750; color: var(--ink); line-height: 1.1; letter-spacing: -.5px; }
.card-num.green { color: var(--success); }
.card-num.orange { color: var(--warning); }
.card-num.blue { color: var(--primary); }
.card-trend { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.card-trend b { color: var(--success); font-weight: 600; }
.card-icon.c-blue { background: #dbeafe; color: #2563eb; --card-tint: rgba(37,99,235,.12); }
.card-icon.c-green { background: #dcfce7; color: #16a34a; --card-tint: rgba(22,163,74,.1); }
.card-icon.c-orange { background: #fef3c7; color: #d97706; --card-tint: rgba(245,158,11,.1); }
.card-icon.c-cyan { background: #cffafe; color: #0891b2; --card-tint: rgba(8,145,178,.1); }
.card.c-blue { --card-tint: rgba(37,99,235,.12); }
.card.c-green { --card-tint: rgba(22,163,74,.1); }
.card.c-orange { --card-tint: rgba(245,158,11,.1); }
.card.c-cyan { --card-tint: rgba(8,145,178,.1); }

/* ========== 面板 ========== */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,.6);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { display: flex; align-items: center; gap: 9px; }
.panel-head h3::before { content: ''; width: 3px; height: 15px; background: linear-gradient(180deg, var(--primary), var(--accent)); border-radius: 2px; }
.link { font-size: 13px; font-weight: 500; }
.link:hover { color: var(--primary-dark); }
.flash {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  animation: slideIn .3s ease;
}
.flash::before { content: '✓'; width: 20px; height: 20px; background: #10b981; color: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.tip { color: var(--muted); font-size: 13px; line-height: 1.7; }

/* ========== 表格 ========== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child { border-radius: 0 8px 8px 0; }
.table tr:hover td { background: #f8fbff; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty-icon { display: block; font-size: 42px; margin-bottom: 12px; opacity: .5; }
.cell-small { font-size: 12px; color: var(--muted); max-width: 160px; word-break: break-all; }
.plate-badge {
  display: inline-block;
  font-family: "SF Mono", Consolas, monospace;
  font-weight: 700;
  font-size: 13px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: .5px;
}
.ops { white-space: nowrap; }
.ops a { margin-right: 12px; font-size: 13px; }
.ops a:last-child { color: var(--danger); }
.ops a:last-child:hover { color: #be123c; }

/* ========== 标签 ========== */
.tag { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-ok { background: #dcfce7; color: #15803d; }
.tag-no { background: #ffe4e6; color: #be123c; }
.tag-warn { background: #fef3c7; color: #b45309; }
.tag-info { background: #dbeafe; color: #1d4ed8; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 17px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.12); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #3b82f6, var(--primary)); color: #fff; box-shadow: 0 6px 20px rgba(37,99,235,.4); }
.btn-block { width: 100%; }
.btn-mini { padding: 4px 11px; font-size: 12px; border-radius: 6px; }
.form-actions { margin-top: 10px; display: flex; gap: 10px; }

/* ========== 表单 ========== */
.form-row { display: flex; gap: 18px; flex-wrap: wrap; }
.form-item { flex: 1; min-width: 200px; margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 7px; color: var(--text); font-weight: 500; font-size: 13px; }
.form-item input, .form-item select, .search-form input, .search-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
}
.form-item input:focus, .form-item select:focus, .search-form input:focus, .search-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-item input::placeholder, .search-form input::placeholder { color: #cbd5e1; }
.search-form { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-form input { max-width: 300px; }
.search-form select { max-width: 160px; }
.import-box {
  background: linear-gradient(135deg, #f8fbff, #f0f7ff);
  border: 1.5px dashed #bfdbfe;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.import-box input { margin: 0 4px; }
.toolbar { display: flex; gap: 9px; flex-wrap: wrap; }

/* ========== 分页 ========== */
.pager { margin-top: 20px; text-align: right; display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.pager a {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  transition: var(--transition);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager a.cur { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,.3); }

/* ========== 代码框 ========== */
.code-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; font-size: 13px; }
.code-box > div { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-box > div:last-child { margin-bottom: 0; }
.code-box span { color: var(--muted); min-width: 130px; }
.code-box code {
  background: #fff;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--primary-dark);
  font-family: "SF Mono", Consolas, monospace;
  word-break: break-all;
  flex: 1;
  min-width: 200px;
}

/* ========== 登录页 ========== */
.login-body {
  background: linear-gradient(135deg, #0f2745 0%, #173a6a 45%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.login-body::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.22), transparent 65%);
  top: -180px; right: -120px;
}
.login-body::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.25), transparent 65%);
  bottom: -160px; left: -100px;
}
.login-box {
  width: 400px;
  max-width: 100%;
  background: rgba(255,255,255,.98);
  border-radius: 20px;
  padding: 38px 38px 32px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(20px);
  animation: loginIn .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo .login-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  display: grid; place-items: center;
  font-size: 30px;
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
}
.login-logo .login-title { font-size: 21px; font-weight: 750; color: var(--ink); }
.login-logo .login-subtitle { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.login-box label { display: block; margin-bottom: 7px; color: var(--text); font-weight: 500; font-size: 13px; }
.login-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-box .btn-primary { margin-top: 4px; padding: 12px; font-size: 15px; }
.login-error { color: var(--danger); background: #fff1f2; border: 1px solid #fecdd3; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ========== 响应式 ========== */
@media (max-width: 860px) {
  .sidebar { width: 68px; }
  .sidebar-logo { padding: 20px 15px; justify-content: center; }
  .logo-text, .logo-sub, .nav-label, .sidebar nav a span.nav-text, .user-meta, .logout-link { display: none; }
  .sidebar nav a { justify-content: center; padding: 12px; }
  .sidebar nav a.active::before { left: -12px; }
  .sidebar-user { justify-content: center; padding: 14px; }
}

@media (max-width: 640px) {
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .sidebar::before { display: none; }
  .sidebar-logo { padding: 10px 14px; border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); }
  .sidebar nav { display: flex; padding: 6px 8px; overflow-x: auto; gap: 2px; }
  .sidebar nav a { padding: 9px 11px; margin-bottom: 0; white-space: nowrap; gap: 6px; font-size: 12px; }
  .sidebar nav a.active::before { display: none; }
  .sidebar-user { display: none; }
  .layout { flex-direction: column; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar-title { font-size: 15px; }
  .topbar-right { display: none; }
  .content { padding: 16px 14px 30px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 16px; }
  .card-num { font-size: 24px; }
  .card-icon { width: 34px; height: 34px; font-size: 16px; }
  .panel { padding: 16px; border-radius: 12px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 10px 8px; }
  .form-item { min-width: 100%; }
  .code-box span { min-width: 100%; }
  /* 有底部导航时，移动端隐藏顶部侧栏，避免重复 */
  .sidebar { display: none; }
  .content { padding-bottom: 84px; }
}

/* ============================================
   v3 新增：底部导航 / 分级标签 / 接入说明 / 用户管理
   ============================================ */

/* 移动端底部导航 */
.bottom-nav { display: none; }

/* 分级角色标签 */
.tag-super { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #92400e; }
.tag-operator { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #1e40af; }
.tag-viewer { background: #f1f5f9; color: #475569; }
.role-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; background: #f8fafc; border-radius: 10px; font-size: 12px; color: var(--muted); }
.role-legend > span { display: flex; align-items: center; gap: 6px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-box { width: 400px; max-width: 100%; background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: loginIn .25s ease; }
.modal-box h3 { margin-bottom: 6px; }

/* 接入说明页 */
.guide-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg,#1e3a8a,#2563eb 60%,#0ea5e9); color: #fff; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(37,99,235,.25); position: relative; overflow: hidden; }
.guide-hero::after { content:''; position:absolute; right:-40px; top:-60px; width:220px; height:220px; border-radius:50%; background:radial-gradient(circle,rgba(255,255,255,.15),transparent 70%); }
.guide-hero-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.25); }
.guide-steps { list-style: none; padding: 0; margin: 0; }
.guide-steps li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-steps li:last-child { border-bottom: none; }
.step-num { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: var(--primary-dark); font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.step-body b { color: var(--ink); font-size: 14px; }
.step-body p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.step-body code, .tip code { background: #eff6ff; color: var(--primary-dark); padding: 2px 7px; border-radius: 5px; font-family: "SF Mono", Consolas, monospace; font-size: 12px; }
.guide-note { display: flex; gap: 14px; background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1px solid #fde68a; border-radius: 10px; padding: 16px 18px; }
.guide-note-icon { font-size: 26px; flex-shrink: 0; }
.guide-note p { margin: 0 0 6px; color: #78350f; font-size: 13px; line-height: 1.7; }
.guide-note p:last-child { margin-bottom: 0; }
.proto-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; margin-top: 12px; }
.proto-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.proto-title { font-weight: 600; color: var(--ink); font-size: 13px; margin-bottom: 8px; }
.proto-card pre { margin: 0; background: #0f172a; color: #7dd3fc; padding: 12px; border-radius: 7px; font-size: 11px; overflow-x: auto; line-height: 1.5; }

/* ========== 新登录页：左右分栏 ========== */
.login-page { background: #f1f5f9; }
.login-split { display: flex; min-height: 100vh; }
.login-brand {
  flex: 1;
  background: linear-gradient(150deg,#0f2745 0%,#173a6a 50%,#1d4ed8 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 8%;
  position: relative;
  overflow: hidden;
}
.brand-glow { position:absolute; width:500px; height:500px; border-radius:50%; background:radial-gradient(circle,rgba(56,189,248,.25),transparent 65%); top:-150px; right:-150px; }
.brand-inner { position: relative; z-index: 1; max-width: 460px; }
.brand-logo { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg,#3b82f6,#0ea5e9); display: grid; place-items: center; font-size: 34px; box-shadow: 0 12px 30px rgba(14,165,233,.4); margin-bottom: 28px; }
.login-brand h1 { font-size: 32px; font-weight: 750; margin: 0 0 12px; letter-spacing: -.5px; }
.brand-slogan { font-size: 16px; color: #93c5fd; margin: 0 0 40px; letter-spacing: 1px; }
.brand-features { display: flex; flex-direction: column; gap: 20px; }
.feature { display: flex; align-items: center; gap: 14px; }
.feature-ico { width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.feature b { display: block; font-size: 15px; font-weight: 600; }
.feature small { display: block; color: #93c5fd; font-size: 12px; margin-top: 3px; }
.brand-footer { position: absolute; bottom: 24px; left: 8%; color: #5b7a9f; font-size: 12px; z-index: 1; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card-head { margin-bottom: 32px; }
.login-card-head h2 { font-size: 28px; font-weight: 750; color: var(--ink); margin: 0 0 8px; }
.login-card-head p { color: var(--muted); margin: 0; font-size: 14px; }
.login-field { margin-bottom: 20px; }
.login-field label { display: block; margin-bottom: 8px; color: var(--text); font-weight: 600; font-size: 13px; }
.input-wrap { position: relative; }
.input-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .6; }
.input-wrap input { width: 100%; padding: 13px 14px 13px 42px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; transition: var(--transition); background: #fff; }
.input-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-submit { padding: 13px !important; font-size: 15px !important; margin-top: 8px; }
.login-card .login-error { display: block; }
.login-card .login-foot { border: none; padding: 0; margin-top: 24px; }

/* ========== 新登录页 + 底部导航 移动端 ========== */
@media (max-width: 860px) {
  .login-brand { display: none; }
  .login-panel { flex: 1; }
}
@media (max-width: 640px) {
  /* 底部导航 */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(15,23,42,.06);
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    transition: var(--transition);
  }
  .bottom-nav a .bn-ico { font-size: 20px; filter: grayscale(.4); transition: var(--transition); }
  .bottom-nav a.active { color: var(--primary); font-weight: 600; }
  .bottom-nav a.active .bn-ico { filter: none; transform: translateY(-2px); }
  .body-with-bottomnav { padding-bottom: 62px; }
  .login-card-head h2 { font-size: 24px; }
  .guide-hero { padding: 18px; gap: 12px; }
  .guide-hero h2 { font-size: 18px; }
  .brand-features { gap: 14px; }
}

/* ============================================
   v4：移动端专属优化（手机优先）
   表格卡片化 / 登录页品牌 / 顶栏用户 / 图标修复
   ============================================ */

/* ---------- 1. 图标：用 CSS 圆点替代 emoji，避免安卓显示方框 ---------- */
.input-wrap .input-ico.ico-user,
.input-wrap .input-ico.ico-lock {
  width: 16px; height: 16px;
  display: inline-block;
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  opacity: 1;
}
.input-wrap .input-ico.ico-user {
  border: 2px solid #94a3b8; border-radius: 50%;
  background: radial-gradient(circle at 50% 68%, #94a3b8 0 3px, transparent 3.5px);
  box-sizing: border-box;
}
.input-wrap .input-ico.ico-user::after {
  content: ''; position: absolute; left: 2px; bottom: -5px;
  width: 8px; height: 6px; border: 2px solid #94a3b8; border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.input-wrap .input-ico.ico-lock {
  border: 2px solid #94a3b8; border-radius: 3px;
  background: transparent;
}
.input-wrap .input-ico.ico-lock::before {
  content: ''; position: absolute; left: 2px; top: -7px;
  width: 8px; height: 7px; border: 2px solid #94a3b8; border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.input-wrap .input-ico.ico-lock::after {
  content: ''; position: absolute; left: 5px; top: 3px;
  width: 3px; height: 4px; background: #94a3b8; border-radius: 1px;
}

/* ---------- 2. 登录页移动端：顶部品牌区 ---------- */
.login-mobile-brand { display: none; }

@media (max-width: 860px) {
  .login-mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 32px;
  }
  .login-mobile-brand .brand-logo {
    width: 60px; height: 60px; border-radius: 17px;
    background: linear-gradient(135deg,#3b82f6,#0ea5e9);
    display: grid; place-items: center; font-size: 30px;
    box-shadow: 0 10px 26px rgba(37,99,235,.32);
    margin-bottom: 14px;
  }
  .login-mobile-brand h1 { font-size: 21px; font-weight: 750; color: var(--ink); margin: 0 0 5px; }
  .login-mobile-brand p { font-size: 12px; color: var(--muted); margin: 0; letter-spacing: .5px; }
  .login-panel { align-items: flex-start; padding-top: 9vh; }
  .login-card-head { margin-bottom: 24px; }
  .login-card-head h2 { font-size: 20px; }
  .login-card-head p { font-size: 13px; }
}

@media (max-width: 380px) {
  .login-panel { padding-top: 5vh; }
  .login-mobile-brand .brand-logo { width: 52px; height: 52px; font-size: 26px; margin-bottom: 10px; }
  .login-mobile-brand h1 { font-size: 19px; }
}

/* ---------- 3. 顶栏移动端：用户头像 + 退出 ---------- */
.topbar-user { display: none; }
@media (max-width: 640px) {
  .topbar { height: 54px; padding: 0 14px; }
  .topbar-title { font-size: 15px; }
  .topbar-title::before { width: 3px; height: 17px; }
  .topbar-user {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text);
  }
  .topbar-user .avatar-mini {
    width: 28px; height: 28px; border-radius: 9px;
    background: linear-gradient(135deg,#3b82f6,#0ea5e9);
    color: #fff; display: grid; place-items: center;
    font-weight: 600; font-size: 13px;
  }
  .topbar-user .topbar-logout {
    color: var(--muted); font-size: 12px; padding: 5px 8px;
    border-radius: 7px; background: #f1f5f9;
  }
}

/* ---------- 4. 表格 → 卡片（手机优先，核心） ---------- */
@media (max-width: 640px) {
  .table-card-mobile thead { display: none; }
  .table-card-mobile, .table-card-mobile tbody, .table-card-mobile tr, .table-card-mobile td { display: block; width: 100%; }
  .table-card-mobile tbody tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 14px 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
  }
  .table-card-mobile tbody tr:last-child { margin-bottom: 0; }
  .table-card-mobile td {
    border: none;
    padding: 7px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
  }
  .table-card-mobile td::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
  }
  .table-card-mobile td > * { flex: 1; text-align: right; }
  .table-card-mobile td.cell-main {
    border-bottom: 1px dashed var(--line);
    padding-bottom: 10px; margin-bottom: 4px;
  }
  .table-card-mobile td.cell-main::before { display: none; }
  .table-card-mobile td.cell-main > * { text-align: left; }
  .table-card-mobile td.cell-main .plate-badge { font-size: 16px; padding: 5px 12px; }
  .table-card-mobile td.empty-cell {
    display: block; text-align: center; padding: 30px 10px; color: var(--muted);
  }
  .table-card-mobile td.empty-cell::before { display: none; }
  .table-card-mobile .ops { display: flex; gap: 14px; justify-content: flex-end; }
  .table-card-mobile .ops a { margin: 0; font-size: 13px; padding: 4px 0; }
  /* 卡片内标签靠右 */
  .table-card-mobile td .tag { text-align: center; }
}

/* ---------- 5. 搜索表单移动端：输入框+按钮同行 ---------- */
@media (max-width: 640px) {
  .search-form { gap: 8px; }
  .search-form input { max-width: none; flex: 1 1 100%; }
  .search-form select { max-width: none; flex: 1 1 120px; }
  .search-form button.btn { flex: 0 0 auto; padding: 9px 20px; }
  .toolbar .btn { flex: 1 1 auto; }
}

/* ---------- 6. 接口地址框移动端：整行显示 + 按钮独立 ---------- */
@media (max-width: 640px) {
  .code-box > div { align-items: stretch; }
  .code-box span { min-width: 100%; }
  .code-box code { min-width: 100%; flex: 1 1 100%; word-break: break-all; }
}

/* ---------- 7. 面板标题移动端：允许换行 ---------- */
@media (max-width: 640px) {
  .panel-head h3 { font-size: 15px; line-height: 1.4; }
  .panel-head { gap: 10px; }
}

/* ---------- 8. 纯 CSS 汽车图标（替代 emoji，避免安卓方框） ---------- */
.car-ico {
  position: relative;
  display: inline-block;
  width: 26px; height: 16px;
  background: #fff;
  border-radius: 4px 6px 3px 3px;
  box-shadow: inset 0 -3px 0 rgba(37,99,235,.15);
}
.car-ico::before {
  content: '';
  position: absolute;
  left: 4px; right: 4px; top: -6px;
  height: 9px;
  background: #fff;
  border-radius: 5px 5px 0 0;
}
.car-ico::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; bottom: -4px;
  height: 6px;
  background: radial-gradient(circle at 5px 50%, #1e40af 0 3px, transparent 3.5px),
              radial-gradient(circle at calc(100% - 5px) 50%, #1e40af 0 3px, transparent 3.5px);
}

/* ========== v5：个人中心页 ========== */
.profile-card { display: flex; align-items: center; gap: 16px; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 18px;
  background: linear-gradient(135deg,#3b82f6,#0ea5e9);
  color: #fff; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(37,99,235,.3);
}
.profile-name { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.profile-perms { padding-top: 16px; }
.profile-perms-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
.profile-perms-list { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 500;
}
.profile-links { display: flex; flex-direction: column; }
.profile-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); transition: var(--transition);
}
.profile-link:last-child { border-bottom: none; }
.profile-link:hover { padding-left: 8px; }
.pl-ico {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg,#eff6ff,#dbeafe);
  display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
}
.pl-body { flex: 1; min-width: 0; }
.pl-body b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.pl-body small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pl-arrow { font-size: 24px; color: var(--muted); }

/* ============================================
   v9：小程序式页面加载遮罩（白色半透明层 + 小卡片）
   ============================================ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.82);   /* 纯白半透明层，不模糊 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility 0s linear .22s;
  -webkit-tap-highlight-color: transparent;
}
.page-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .16s ease, visibility 0s;
}

.pl-box {
  width: 104px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  transform: scale(.92);
  opacity: .6;
  transition: transform .26s cubic-bezier(.22,1,.36,1), opacity .2s ease;
}
.page-loader.is-active .pl-box { transform: scale(1); opacity: 1; }

/* 淡蓝天蓝色分段圆弧 + 中心小圆点，整体旋转 */
.pl-spin {
  width: 40px;
  height: 40px;
  display: block;
  animation: plRotate .8s linear infinite;
}
.pl-text {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1;
  letter-spacing: .02em;
}

@keyframes plRotate { to { transform: rotate(360deg); } }

/* 点击导航的即时反馈（不显示遮罩） */
.bottom-nav a:active,
.sidebar nav a:active { background: rgba(37,99,235,.08); }

@media (max-width: 640px) {
  .pl-box { width: 98px; min-height: 90px; padding: 14px 10px 12px; }
  .pl-spin { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-spin { animation-duration: 2s !important; }
  .pl-box { transform: none; }
  html { scroll-behavior: auto; }
}

/* ========== v6.1：登录页「记住密码」 ========== */
.login-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -6px 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  color: var(--text);
  font-size: 13px;
}
.checkbox-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.checkbox-box {
  position: relative;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  transition: var(--transition);
}
.checkbox-label:hover .checkbox-box { border-color: var(--primary); }
.checkbox-label input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.28);
}
.checkbox-label input:checked + .checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-label input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.login-remember-tip { font-size: 11.5px; color: #a8b4c4; }
@media (max-width: 640px) {
  .login-remember { margin: -4px 0 20px; }
  .login-remember-tip { font-size: 11px; }
}

/* v6.2：让隐藏的 checkbox 本体可点击（兼容自动化与辅助技术） */
.checkbox-label { position: relative; }
.checkbox-label input {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  z-index: 1;
  cursor: pointer;
}

/* ========== v7：多停车场 ========== */
.topbar-lot select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  max-width: 160px;
}
.topbar-lot select:focus { outline: none; border-color: var(--primary); }
.sub-title { font-size: 14px; font-weight: 650; color: var(--ink); margin: 22px 0 12px; }
.device-code { font-size: 12px; color: #475569; background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }

/* 停车场勾选（用户授权） */
.lot-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.lot-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
  transition: var(--transition);
}
.lot-check:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.lot-check input { accent-color: var(--primary); width: 15px; height: 15px; }

/* 首页停车场切换 */
.lot-switch-panel { margin-bottom: 4px; }
.lot-switch-list { display: flex; flex-wrap: wrap; gap: 10px; }
.lot-chip {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); font-size: 13px; background: #fff; transition: var(--transition);
}
.lot-chip:hover { border-color: var(--primary); color: var(--primary); }
.lot-chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 4px 12px rgba(37,99,235,.25); }

@media (max-width: 640px) {
  .topbar-lot { display: none; }  /* 手机端顶栏窄，切换用首页卡片 */
  .lot-chip { padding: 8px 13px; font-size: 12px; }
}
