/* ================================================
   换电记录管理系统 - 主样式文件
   设计风格：现代方形、不对称布局、无紫色
   ================================================ */

:root {
  --primary: #0f4c81;
  --primary-dark: #0a3460;
  --primary-light: #1a6db5;
  --accent: #e8500a;
  --accent-light: #ff6b2b;
  --success: #1e7e34;
  --success-light: #28a745;
  --danger: #c0392b;
  --danger-light: #e74c3c;
  --warning: #d68910;
  --warning-light: #f39c12;
  --info: #117a8b;
  --info-light: #17a2b8;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --white: #ffffff;
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 0px;
  --radius-sm: 0px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.13);
  --transition: 0.18s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-light);
}

img { max-width: 100%; }

/* ================================================
   登录 / 注册页
   ================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--gray-900);
}

.auth-left {
  width: 52%;
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: rgba(255,255,255,0.05);
  transform: rotate(25deg);
}

.auth-left::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,0.04);
  transform: rotate(-15deg);
}

.auth-brand {
  position: relative;
  z-index: 1;
}

.auth-brand .logo-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 28px;
  color: #fff;
  border-left: 3px solid var(--accent);
}

.auth-brand h1 {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.3;
  margin-bottom: 16px;
}

.auth-brand p {
  color: rgba(255,255,255,0.72);
  font-size: 1rem;
  line-height: 1.8;
}

.auth-features {
  margin-top: 48px;
  position: relative;
  z-index: 1;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
}

.auth-feature-item:last-child { border-bottom: none; }

.auth-feature-item .fi-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-light);
  flex-shrink: 0;
}

.auth-right {
  width: 48%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 72px;
}

.auth-form-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.auth-form-subtitle {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  border-radius: 0;
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(15,76,129,0.12);
}

.form-control::placeholder {
  color: var(--gray-400);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c757d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover {
  background: var(--accent-light);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover {
  background: var(--success-light);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover {
  background: var(--danger-light);
  color: var(--white);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover {
  background: var(--warning-light);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}
.btn-secondary:hover {
  background: var(--gray-300);
  color: var(--gray-800);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 13px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.auth-footer-link {
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--gray-600);
}

.auth-footer-link a {
  color: var(--primary);
  font-weight: 600;
}

/* ================================================
   后台整体布局
   ================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

.sidebar-logo {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-box {
  width: 40px;
  height: 40px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-left: 3px solid var(--accent);
}

.sidebar-logo .logo-box span {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.sidebar-logo .logo-text {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.sidebar-logo .logo-text small {
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  padding: 16px 18px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 22px;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: var(--white);
  background: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 主内容区 */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航 */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.breadcrumb a {
  color: var(--gray-500);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--gray-400);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  transition: background var(--transition);
}

.topbar-user:hover {
  background: var(--gray-100);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.2;
}

.user-info .user-role {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* 页面内容区 */
.page-body {
  flex: 1;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.page-header-left p {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ================================================
   卡片
   ================================================ */
.card {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ================================================
   统计卡片
   ================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.stat-blue::before { background: var(--primary); }
.stat-card.stat-orange::before { background: var(--accent); }
.stat-card.stat-green::before { background: var(--success); }
.stat-card.stat-teal::before { background: var(--info); }

.stat-info {}

.stat-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.stat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.si-blue { background: rgba(15,76,129,0.1); color: var(--primary); }
.stat-icon.si-orange { background: rgba(232,80,10,0.1); color: var(--accent); }
.stat-icon.si-green { background: rgba(30,126,52,0.1); color: var(--success); }
.stat-icon.si-teal { background: rgba(17,122,139,0.1); color: var(--info); }

/* ================================================
   表格
   ================================================ */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  background: var(--gray-800);
  color: rgba(255,255,255,0.85);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody td {
  padding: 13px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr:last-child {
  border-bottom: none;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ================================================
   状态标签
   ================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-success { background: rgba(30,126,52,0.12); color: var(--success); }
.badge-danger  { background: rgba(192,57,43,0.12); color: var(--danger); }
.badge-warning { background: rgba(214,137,16,0.12); color: var(--warning); }
.badge-info    { background: rgba(17,122,139,0.12); color: var(--info); }
.badge-primary { background: rgba(15,76,129,0.12); color: var(--primary); }
.badge-gray    { background: var(--gray-200); color: var(--gray-600); }

/* ================================================
   提示信息
   ================================================ */
.alert {
  padding: 12px 18px;
  font-size: 0.9rem;
  margin-bottom: 18px;
  border-left: 4px solid transparent;
}

.alert-success {
  background: rgba(30,126,52,0.08);
  border-color: var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(192,57,43,0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.alert-info {
  background: rgba(15,76,129,0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.alert-warning {
  background: rgba(214,137,16,0.08);
  border-color: var(--warning);
  color: var(--warning);
}

/* ================================================
   搜索/筛选栏
   ================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  margin-bottom: 18px;
}

.filter-bar .form-control {
  min-width: 160px;
  background: var(--white);
  padding: 8px 12px;
  font-size: 0.87rem;
}

.filter-bar select.form-control {
  min-width: 140px;
}

/* ================================================
   分页
   ================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 14px 0 4px;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  background: var(--white);
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ================================================
   模态框
   ================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 18px;
  transition: all var(--transition);
  background: transparent;
  border: none;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ================================================
   表单布局
   ================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ================================================
   详情页
   ================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.detail-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.detail-item:nth-child(odd) {
  border-right: 1px solid var(--gray-200);
}

.detail-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
  min-width: 90px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--gray-800);
  font-weight: 500;
}

/* ================================================
   排行榜
   ================================================ */
.rank-list {
  list-style: none;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}

.rank-item:hover { background: var(--gray-50); }
.rank-item:last-child { border-bottom: none; }

.rank-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--gray-200);
  color: var(--gray-600);
}

.rank-num.top1 { background: var(--accent); color: #fff; }
.rank-num.top2 { background: var(--warning); color: #fff; }
.rank-num.top3 { background: var(--info); color: #fff; }

.rank-info { flex: 1; }

.rank-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
}

.rank-sub {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.rank-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.rank-bar-wrap {
  margin-top: 6px;
  height: 4px;
  background: var(--gray-200);
  flex: 1;
}

.rank-bar {
  height: 4px;
  background: var(--primary);
}

/* ================================================
   空状态
   ================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.92rem;
}

/* ================================================
   底部
   ================================================ */
.site-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.5);
  padding: 22px 28px;
  font-size: 0.80rem;
  line-height: 1.9;
  margin-left: 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {}

.footer-icp a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-icp a:hover {
  color: rgba(255,255,255,0.85);
}

/* 后台页面底部 */
.backend-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.4);
  padding: 16px 28px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 0;
}

.backend-footer a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.backend-footer a:hover {
  color: rgba(255,255,255,0.75);
}

/* ================================================
   数据概览图表区域
   ================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.quick-action-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.quick-action-btn .qa-icon {
  font-size: 1.5rem;
}

/* ================================================
   二级统计小卡片
   ================================================ */
.mini-stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.mini-stat-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.mini-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
}
.mini-stat-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ================================================
   响应式 / 移动端适配
   ================================================ */

/* --- 响应式通用网格类 --- */
.grid-2col    { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3col    { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-detail  { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.grid-areas   { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.grid-cabinets{ display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }

/* --- 汉堡菜单按钮（移动端显示）--- */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px;
  flex-shrink: 0;
  margin-right: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-700);
  transition: all 0.22s ease;
  transform-origin: center;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- 侧边栏遮罩（移动端）--- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ================================================
   响应式媒体查询
   ================================================ */

/* ≤1100px 平板 */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
  .grid-3col { grid-template-columns: 1fr 1fr; }
  .grid-detail { grid-template-columns: 1fr; }
  .grid-areas  { grid-template-columns: 1fr; }
  .grid-cabinets { grid-template-columns: 1fr; }
  /* 兼容内联style的双列 */
  .areas-layout,
  .cabinets-layout { grid-template-columns: 1fr !important; }
}

/* ≤900px 平板/大屏手机 */
@media (max-width: 900px) {
  /* 登录注册 */
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 40px 32px; }

  /* 侧边栏抽屉 */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 28px rgba(0,0,0,0.28);
  }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }

  /* topbar */
  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 0.95rem; }
  .user-info { display: none; }

  /* 布局 */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid-3col { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px 14px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-child(odd) { border-right: none; }
  .backend-footer { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; }

  /* 筛选栏 */
  .filter-bar { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .filter-bar .form-control { min-width: 0; flex: 1 1 calc(50% - 8px); }
}

/* ≤600px 手机 */
@media (max-width: 600px) {
  /* 统计卡片 */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 1.5rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 17px; }

  /* 网格全部单列 */
  .grid-2col,
  .grid-3col,
  .grid-detail { grid-template-columns: 1fr !important; }

  /* 页面头 */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header > a.btn,
  .page-header > button.btn { width: 100%; justify-content: center; }
  .page-header > div[style*="display:flex"] { flex-direction: column; width: 100%; }
  .page-header > div[style*="display:flex"] .btn { width: 100%; justify-content: center; }

  /* 筛选栏完全竖排 */
  .filter-bar { flex-direction: column; padding: 12px; gap: 8px; }
  .filter-bar .form-control,
  .filter-bar select.form-control,
  .filter-bar input.form-control { width: 100%; flex: unset; min-width: 0; }
  .filter-bar .btn { width: 100%; justify-content: center; }

  /* 表格 -> 卡片模式 */
  .table-wrap { overflow-x: visible; }
  table { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: block; }
  tbody tr {
    display: block;
    border: 1px solid var(--gray-200);
    margin-bottom: 10px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--primary);
  }
  tbody tr:last-child { margin-bottom: 0; }
  tbody tr:hover { background: var(--gray-50); }
  tbody td {
    display: flex;
    align-items: flex-start;
    padding: 9px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    gap: 0;
    min-height: 36px;
  }
  tbody td:last-child { border-bottom: none; }
  tbody td[data-label]::before {
    content: attr(data-label);
    min-width: 76px;
    width: 76px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--gray-400);
    flex-shrink: 0;
    padding-top: 2px;
    letter-spacing: 0.2px;
  }
  tbody td.td-num { display: none; }
  .td-actions { flex-wrap: wrap; gap: 6px; }
  .td-actions .btn { flex: 1; justify-content: center; min-width: 60px; }

  /* 卡片 */
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px; }
  .card-footer { padding: 10px 14px; flex-wrap: wrap; }

  /* 模态框 */
  .modal { width: 96vw; max-width: 96vw; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* 表单 */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* 分页 */
  .pagination { flex-wrap: wrap; gap: 4px; justify-content: center; }
  .page-btn { width: 36px; height: 36px; font-size: 0.85rem; }

  /* 底部 */
  .site-footer { padding: 16px 14px; text-align: center; }
  .footer-inner { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .backend-footer { font-size: 0.74rem; text-align: center; align-items: center; }

  /* topbar */
  .topbar { height: 54px; padding: 0 10px; }
  .topbar-title { font-size: 0.88rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-accent { display: none; }

  /* 详情项 */
  .detail-item { flex-direction: column; gap: 4px; padding: 12px 14px; }
  .detail-label { min-width: unset; }

  /* 面包屑 */
  .breadcrumb { display: none; }

  /* 登录注册 */
  .auth-right { padding: 28px 18px !important; }
  .auth-form-title { font-size: 1.3rem; }

  /* 排行榜 */
  .rank-item { padding: 10px 12px; gap: 10px; }

  /* 快捷操作 */
  .quick-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-action-btn { padding: 14px 8px; font-size: 0.82rem; }

  /* 二级统计卡片（内联style grid） */
  .mini-stats-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
}

/* ≤480px 小手机 */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.4rem; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}

/* ≤400px 极小屏 */
@media (max-width: 400px) {
  html { font-size: 14px; }
  .topbar-title { max-width: 110px; }
  .page-body { padding: 12px 10px; }
}

/* ================================================
   辅助工具类
   ================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--gray-500); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

/* 删除确认按钮组 */
.confirm-delete {
  display: none;
  align-items: center;
  gap: 6px;
}

/* 开关 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-400);
  transition: var(--transition);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background: white;
  transition: var(--transition);
}

input:checked + .toggle-slider {
  background: var(--success);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* 不对称装饰线 */
.section-accent-line {
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 16px;
}

.page-header-left .section-accent-line {
  margin-bottom: 8px;
}

/* 顶部bar强调色块 */
.topbar-accent {
  width: 4px;
  height: 28px;
  background: var(--accent);
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

/* 表格序号 */
.td-num {
  width: 42px;
  font-size: 0.78rem;
  color: var(--gray-400);
  font-weight: 700;
}

/* 登录页增强效果 */
.auth-deco {
  position: absolute;
  bottom: 40px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.04);
  transform: rotate(45deg);
  z-index: 0;
}

/* 状态切换按钮 */
.status-btn {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.status-btn.active-status {
  background: rgba(30,126,52,0.1);
  color: var(--success);
  border: 1px solid rgba(30,126,52,0.3);
}

.status-btn.inactive-status {
  background: rgba(192,57,43,0.1);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,0.3);
}

.status-btn:hover {
  filter: brightness(0.88);
}
