/* ============ 全局样式 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 220px;
  --header-h: 56px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px;
}

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

.hidden { display: none !important; }

/* 额外保险：隐藏元素永远不接收指针事件 */
.modal.hidden { pointer-events: none !important; }

/* ============ 登录页面 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}

.login-logo h1 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 6px;
}

.login-logo p {
  font-size: 12px;
  color: var(--text-secondary);
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

/* ============ 布局 ============ */
.app {
  min-height: 100vh;
}

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-title {
  font-size: 16px;
  font-weight: 600;
}

.user-info {
  font-size: 13px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 99;
  transition: transform 0.3s;
}

.nav-menu {
  list-style: none;
  padding: 10px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 20px;
  min-height: calc(100vh - var(--header-h));
}

.overlay {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
}

/* ============ 卡片/面板 ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ============ 统计卡片 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-red .stat-icon { background: var(--danger-light); }
.stat-yellow .stat-icon { background: var(--warning-light); }
.stat-blue .stat-icon { background: var(--info-light, #e0f2fe); }
.stat-gray .stat-icon { background: #f3f4f6; }

.stat-info h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.stat-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ============ 表单 ============ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > .form-group {
  flex: 1;
  min-width: 180px;
}

/* ============ 表格 ============ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

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

th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 名称列允许换行 */
td.col-name {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
}

/* 备注列允许换行 */
td.col-remark {
  white-space: normal;
  word-break: break-word;
  min-width: 100px;
}

/* 材料列允许换行 */
td.col-materials {
  white-space: normal;
  word-break: break-word;
  min-width: 140px;
}

/* 操作列不换行 */
td.col-actions {
  white-space: nowrap;
  max-width: none;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
}

tr:hover {
  background: #f8fafc;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 600; }

/* ============ 标签 ============ */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-orange { background: #fff7ed; color: #ea580c; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }

/* ============ 图片导入/OCR相关 ============ */
.btn-info {
  background: var(--info);
  color: #fff;
  border: none;
}
.btn-info:hover { background: #0e7490; }

.mat-search-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}
.mat-search-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.mat-dropdown {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.mat-dropdown > div {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.mat-dropdown > div:hover {
  background: #e3f2fd;
}
.mat-dropdown > div:last-child {
  border-bottom: none;
}

#dropZone {
  transition: all 0.2s;
}
#dropZone:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}
#dropZone.dragover {
  border-color: var(--primary);
  background: #e3f2fd;
}

/* ============ 筛选栏 ============ */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 140px;
}

/* ============ 弹窗 ============ */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: opacity 0.3s;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }

/* ============ 图表 ============ */
.chart-container {
  position: relative;
  width: 100%;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 200px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bar {
  width: 80%;
  max-width: 40px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s;
  min-height: 2px;
  position: relative;
}

.bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.bar-value {
  font-size: 10px;
  color: var(--text);
  font-weight: 600;
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .app-title {
    font-size: 14px;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-info h3 {
    font-size: 18px;
  }

  .card {
    padding: 14px;
  }

  .modal-content {
    width: 95%;
    padding: 16px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .form-group {
    width: 100%;
  }

  th, td {
    padding: 8px;
    font-size: 12px;
  }

  td.col-name {
    min-width: 80px;
  }

  td.col-remark {
  }

  td.col-materials {
  }

  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .user-info {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row > .form-group {
    min-width: 100%;
  }
}

/* ============ 进度条 ============ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s;
}

/* ============ 提示框 ============ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-light);
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ============ 工具类 ============ */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.gap-16 { gap: 16px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-secondary { color: var(--text-secondary); }
.w-full { width: 100%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

/* ============ 角色标签 ============ */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}
.role-badge.super_admin { background: #fce7f3; color: #9f1239; }
.role-badge.operator { background: #dbeafe; color: #1e40af; }
.role-badge.viewer { background: #f1f5f9; color: #475569; }

/* 隐藏无权限的导航项 */
.nav-link[data-role] { display: none; }
.nav-link[data-role].visible { display: block; }

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination .page-info {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 8px;
}

/* ============ 确认弹窗 ============ */
.confirm-warning {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #991b1b;
  font-size: 13px;
}
.confirm-warning strong {
  display: block;
  margin-bottom: 4px;
}

/* ============ 高风险标记 ============ */
.high-risk {
  border-left: 3px solid var(--danger);
  padding-left: 8px;
}

/* 只读用户操作按钮隐藏 */
body.role-viewer .write-only,
body.role-viewer .admin-only {
  display: none !important;
}
body.role-operator .admin-only {
  display: none !important;
}

/* ============ 维修管理样式 ============ */
.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-done {
  background: #d1fae5;
  color: #065f46;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.material-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.material-row select {
  flex: 2;
}

.material-row input {
  flex: 1;
  min-width: 80px;
}

.material-row .repair-mat-unit {
  min-width: 40px;
  color: #6b7280;
  font-size: 14px;
}

/* ============ 可搜索物资选择器 ============ */
.material-picker {
  position: relative;
  width: 100%;
}
.mp-display {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  transition: border-color 0.2s;
}
.mp-display:hover { border-color: #3b82f6; }
.mp-display.mp-active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.mp-selected-name { font-size: 14px; color: #1f2937; font-weight: 500; }
.mp-selected-info { font-size: 12px; color: #6b7280; margin-left: 6px; }
.mp-placeholder { font-size: 14px; color: #9ca3af; }
.mp-arrow { font-size: 10px; color: #6b7280; margin-left: 8px; transition: transform 0.2s; }
.mp-display.mp-active .mp-arrow { transform: rotate(180deg); }
.mp-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  margin-top: 4px;
}
.mp-search-wrap { padding: 8px; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: #fff; z-index: 1; }
.mp-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.mp-search:focus { border-color: #3b82f6; }
.mp-list {
  max-height: 400px;
  overflow-y: auto;
}
.mp-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}
.mp-item:hover { background: #eff6ff; }
.mp-item.mp-item-selected { background: #dbeafe; }
.mp-item-name { font-size: 14px; color: #1f2937; }
.mp-item-info { font-size: 12px; color: #6b7280; white-space: nowrap; margin-left: 8px; }
.mp-item.mp-item-low .mp-item-info { color: #ef4444; font-weight: 600; }
.mp-no-result { padding: 16px; text-align: center; color: #9ca3af; font-size: 14px; }
.mp-create-new {
  padding: 10px 12px;
  cursor: pointer;
  background: #f0fdf4;
  border-top: 2px solid #d1fae5;
  color: #15803d;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}
.mp-create-new:hover { background: #dcfce7; }
.mp-load-more {
  padding: 10px 12px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .mp-display { background: #1f2937; border-color: #374151; }
  .mp-display:hover { border-color: #3b82f6; }
  .mp-selected-name { color: #f3f4f6; }
  .mp-placeholder { color: #6b7280; }
  .mp-dropdown { background: #1f2937; border-color: #374151; }
  .mp-search-wrap { background: #1f2937; border-bottom-color: #374151; }
  .mp-search { background: #374151; border-color: #4b5563; color: #f3f4f6; }
  .mp-item { border-bottom-color: #374151; }
  .mp-item:hover { background: #1e3a5f; }
  .mp-item-name { color: #f3f4f6; }
  .mp-item-info { color: #9ca3af; }
}

/* ============ v14.11 按钮加载动画 ============ */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 2px;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* ============ v14.11 表格固定列（粘性定位） ============ */
table.sticky-cols td:first-child,
table.sticky-cols th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 4px rgba(0,0,0,0.08);
}
table.sticky-cols td:nth-child(2),
table.sticky-cols th:nth-child(2) {
  position: sticky;
  left: 120px;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 4px rgba(0,0,0,0.08);
}
@media (prefers-color-scheme: dark) {
  table.sticky-cols td:first-child,
  table.sticky-cols th:first-child,
  table.sticky-cols td:nth-child(2),
  table.sticky-cols th:nth-child(2) {
    background: #1f2937;
  }
}

/* ============ v14.11 导入进度条 ============ */
.import-progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.import-progress-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px 40px;
  min-width: 360px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.import-progress-box h3 { margin-bottom: 16px; font-size: 16px; color: #1e293b; }
.import-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.import-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}
.import-progress-text { font-size: 14px; color: #64748b; }
.import-progress-detail { font-size: 12px; color: #94a3b8; margin-top: 8px; }
@media (prefers-color-scheme: dark) {
  .import-progress-box { background: #1f2937; }
  .import-progress-box h3 { color: #f3f4f6; }
  .import-progress-bar { background: #374151; }
  .import-progress-text { color: #cbd5e1; }
}

/* ============ v14.11 用户反馈浮动按钮 ============ */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
}
.feedback-fab:active { transform: scale(0.95); }

/* ============ v14.11 虚拟滚动容器 ============ */
.virtual-scroll-container {
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}
.virtual-scroll-spacer {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ============ v14.11 懒加载哨兵 ============ */
.scroll-sentinel {
  height: 1px;
  width: 100%;
}
.scroll-sentinel.loading::after {
  content: '加载中...';
  display: block;
  text-align: center;
  padding: 10px;
  color: #64748b;
  font-size: 14px;
}

/* ============ v14.11 表单校验高亮 ============ */
input.form-invalid, select.form-invalid {
  border-color: #dc3545 !important;
  background: #fef2f2;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ============ V3.0 维修物资报表 ============ */

/* 匹配方式徽章 */
.maint-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.maint-badge-keyword {
  background: #dbeafe;
  color: #1d4ed8;
}
.maint-badge-category {
  background: #dcfce7;
  color: #15803d;
}
.maint-badge-manual {
  background: #fef3c7;
  color: #b45309;
}
.maint-badge-none {
  background: #f3f4f6;
  color: #9ca3af;
}

/* 维修物资报表统计卡 */
.maint-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.maint-stat-card {
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top-width: 3px;
}

/* 关键词库管理表格内嵌 */
#maintKeywordTable .data-table th,
#maintKeywordTable .data-table td {
  font-size: 13px;
}

/* 异常行复核清单模态内表格 */
.maint-exception-list {
  max-height: 260px;
  overflow: auto;
  margin-top: 10px;
  border: 1px solid #fde68a;
  border-radius: 6px;
}
.maint-exception-list .data-table {
  font-size: 12px;
}

/* 匹配方式饼图卡片 */
#maintMatchPie {
  width: 100%;
  height: 280px;
}

/* 维修物资明细表可滚动 */
.maint-detail-scroll {
  max-height: 520px;
  overflow: auto;
}

/* V3.0 维修物资报表 END */
