/* ===== 管理后台全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-card h1 {
  text-align: center;
  font-size: 24px;
  color: #1a73e8;
  margin-bottom: 8px;
}

.login-card .subtitle {
  text-align: center;
  color: #999;
  font-size: 13px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.form-group textarea { resize: vertical; min-height: 60px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
}
.btn-primary:hover { background: #1557b0; }

.btn-success {
  background: #52c41a;
  color: #fff;
}
.btn-success:hover { background: #389e0d; }

.btn-danger {
  background: #ff4d4f;
  color: #fff;
}
.btn-danger:hover { background: #d9363e; }

.btn-warning {
  background: #faad14;
  color: #fff;
}
.btn-warning:hover { background: #d48806; }

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}
.btn-secondary:hover { background: #d9d9d9; }

.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn + .btn { margin-left: 8px; }

.login-btn { padding: 11px; font-size: 15px; }

/* ===== 主布局 ===== */
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: #001529;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

.sidebar-header .user-info {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}

.nav { list-style: none; padding: 8px 0; }

.nav li a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav li a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav li a.active { color: #fff; background: #1a73e8; border-left-color: #fff; }

.nav li a .icon { margin-right: 10px; font-size: 16px; }

/* ===== 菜单自定义排序（直接拖拽） ===== */
.nav li[data-page] { position: relative; cursor: move; }
.nav li[data-page] a { padding-right: 34px; }
.nav li[data-page]::after {
  content: '⠿';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  pointer-events: none;
}
.nav li[data-page]:hover::after { color: rgba(255,255,255,0.75); }
.nav li.dragging { opacity: 0.5; background: rgba(26,115,232,0.25); }
.nav li.drag-over { background: rgba(255,255,255,0.08); }

/* 侧边栏宽度拖拽分隔条 */
.sidebar-resizer {
  position: fixed;
  left: 220px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 150;
  background: transparent;
  transition: background 0.2s;
}
.sidebar-resizer:hover, .sidebar-resizer.active { background: rgba(26,115,232,0.45); }

/* 窄侧边栏（宽度 ≤ 80px）：只显示图标，隐藏文字与拖拽手柄 */
.sidebar.narrow .sidebar-header { padding: 14px 0; text-align: center; }
.sidebar.narrow .sidebar-header h2,
.sidebar.narrow .sidebar-header .user-info { display: none; }
.sidebar.narrow .nav li a { padding: 12px 0; justify-content: center; }
.sidebar.narrow .nav li a span:not(.icon) { display: none; }
.sidebar.narrow .nav li[data-page] a { padding-right: 0; }
.sidebar.narrow .nav li[data-page]::after { display: none; }
.sidebar.narrow .nav li[data-page] { cursor: move; }

/* 主内容区 */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h3 { font-size: 20px; font-weight: 600; }

/* ===== 统计卡片 ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1a73e8; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* ===== 售后分析页签 ===== */
.analysis-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 16px;
}

.analysis-tab {
  padding: 9px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.analysis-tab:hover { color: #1a73e8; }

.analysis-tab.active {
  color: #1a73e8;
  font-weight: 600;
  border-bottom-color: #1a73e8;
}

.analysis-tab-panel { padding-top: 2px; }

/* ===== 表格 ===== */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h4 { font-size: 15px; font-weight: 600; }

.card-body { padding: 20px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

table th {
  background: #fafafa;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

table tr:hover td { background: #f5f7fa; }

table td.actions { white-space: nowrap; }

/* 首行冻结：滚动容器内的表头固定（重复问题明细等长表格） */
table.table-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafafa;
  box-shadow: inset 0 -1px 0 #e8e8e8;
}

/* 场地分析长表格：容器内纵向滚动，配合 .table-sticky-head 冻结表头 */
.pa-table-scroll {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.status-badge.active { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-badge.inactive { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.status-badge.danger { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.status-badge.info { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; }

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}

.role-badge.admin { background: #fff7e6; color: #fa8c16; border-color: #ffd591; }
.role-badge.manager { background: #f6ffed; color: #52c41a; border-color: #b7eb8f; }
.role-badge.supervisor { background: #e6f7ff; color: #1890ff; border-color: #91d5ff; }
.role-badge.after-sales { background: #f9f0ff; color: #722ed1; border-color: #d3adf7; }

/* 角色权限勾选 */
.perm-groups {
  border: 1px solid #e8ecf1;
  border-radius: 6px;
  padding: 8px;
  background: #fafbfc;
}
.perm-module {
  border: 1px solid #eef1f5;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}
.perm-module:last-child { margin-bottom: 0; }
.perm-module-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f7f9fc;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.perm-module-head:hover { background: #eef3fb; }
.perm-module-caret {
  font-size: 11px;
  color: #8a94a6;
  transition: transform 0.15s;
  width: 10px;
}
.perm-module-head.open .perm-module-caret { transform: rotate(90deg); }
.perm-module-title {
  font-weight: 600;
  font-size: 13px;
  color: #0E3A5C;
  flex: 1;
}
.perm-module-checkall {
  font-size: 12px;
  color: #1a73e8;
  cursor: pointer;
}
.perm-module-checkall:hover { text-decoration: underline; }
.perm-module-body {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  padding: 10px 12px;
  border-top: 1px solid #f0f2f5;
}
.perm-item {
  display: inline-flex;
  align-items: center;
  width: 33%;
  margin: 4px 0;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}
.perm-item input { margin-right: 4px; }

/* ===== 维修地图 ===== */
#repairMapContainer { height: 600px; border-radius: 8px; overflow: hidden; }
.map-popup-name { font-weight: 600; color: #1a3a5c; margin-bottom: 4px; }
.map-popup-addr { font-size: 12px; color: #666; margin-bottom: 2px; }
.map-popup-time { font-size: 12px; color: #999; margin-bottom: 4px; }
.map-popup-content { font-size: 13px; color: #333; background: #f5f7fa; padding: 4px 8px; border-radius: 4px; }
.map-filter-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.map-filter-row select, .map-filter-row input { padding: 7px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; outline: none; }
.map-filter-row select:focus, .map-filter-row input:focus { border-color: #1a73e8; }
.map-stats { font-size: 13px; color: #666; padding: 6px 0; }
.map-stats span { margin-right: 16px; }

/* ===== Chart Layout ===== */
 .chart-row { display: flex; gap: 16px; margin-top: 16px; }
 .chart-card { flex: 1; min-width: 0; }
 .chart-card .card-body { height: 280px; padding: 16px 20px; }
 .chart-card canvas { width: 100% !important; height: 100% !important; }

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-bar input, .search-bar select {
  padding: 7px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.search-bar input:focus, .search-bar select:focus { border-color: #1a73e8; }

.search-bar input { width: 180px; }
.search-bar .btn { height: 34px; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 0;
}

.pagination .page-btn {
  padding: 5px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.pagination .page-btn:hover { border-color: #1a73e8; color: #1a73e8; }
.pagination .page-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #999; margin: 0 8px; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 8px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 消息提示 ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toast-in 0.3s ease;
}

.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #1890ff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.fade-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 照片预览 ===== */
.photo-preview { max-width: 100px; max-height: 100px; border-radius: 4px; cursor: pointer; }
.photo-preview-lg { max-width: 300px; max-height: 300px; border-radius: 6px; }
.photo-link { color: #1a73e8; text-decoration: underline; cursor: pointer; font-size: 12px; }

/* ===== 低调删除按钮 ===== */
.btn-delete-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 400;
  color: #999;
  background: transparent;
}
.btn-delete-subtle:hover {
  color: #ff4d4f;
  background: #fff2f0;
  border-color: #ffccc7;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h2, .sidebar-header .user-info, .nav li a span:not(.icon) { display: none; }
  .main-content { margin-left: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .search-bar input { width: 140px; }
  .login-card { width: 340px; padding: 30px 24px; }
}

/* ===== 可搜索下拉框 ===== */
.searchable-select {
  position: relative;
  display: inline-block;
  min-width: 140px;
}

.searchable-select input {
  width: 100%;
  padding: 7px 30px 7px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  background: #fff;
  box-sizing: border-box;
}

.searchable-select input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.searchable-select::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #999;
  pointer-events: none;
}

.searchable-select.open::after {
  content: '▴';
}

.searchable-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 2px;
}

.searchable-select.open .searchable-dropdown {
  display: block;
}

.searchable-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.searchable-option:hover {
  background: #f0f5ff;
}

.searchable-option.selected {
  background: #e6f0ff;
  color: #1a73e8;
  font-weight: 600;
}

.searchable-option.empty {
  color: #999;
  cursor: default;
  text-align: center;
}

.searchable-select.searchable-select-lg {
  min-width: 200px;
}

.searchable-select.searchable-select-lg input {
  padding: 9px 32px 9px 14px;
  font-size: 14px;
}

/* ===== 视图切换标签（场地日志：日志列表 / 按场地） ===== */
.view-tabs {
  display: inline-flex;
  background: #f0f2f5;
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.view-tab {
  border: none;
  background: transparent;
  padding: 6px 18px;
  border-radius: 5px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.view-tab:hover { color: #1a73e8; }

.view-tab.active {
  background: #fff;
  color: #1a73e8;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 宽弹窗（场地详情等大内容） */
.modal-box.modal-wide {
  width: 860px;
  max-width: 94vw;
}

/* 超宽弹窗（重复问题明细等宽表内容） */
.modal-box.modal-xl {
  width: 1200px;
  max-width: 96vw;
  max-height: 92vh;
}

/* ===== 场地日志 - 日志列表：块状阵列 ===== */
.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* ===== 场地日志 - 按场地：卡片阵列 ===== */
.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.place-card {
  background: #fff;
  border: 1px solid #ebedf0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.place-card:hover {
  border-color: #1a73e8;
  box-shadow: 0 4px 16px rgba(26,115,232,0.12);
  transform: translateY(-2px);
}

.place-card-empty { background: #fafafa; }
.place-card-empty:hover { border-color: #d9d9d9; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.place-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.place-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  word-break: break-all;
}

.place-card-time { font-size: 12px; color: #999; white-space: nowrap; }

.place-card-addr { font-size: 12px; color: #999; margin-top: -4px; }

.place-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.place-card-stats span {
  background: #f0f5ff;
  color: #1a73e8;
  border-radius: 4px;
  padding: 2px 8px;
}

.place-card-label {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.place-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.place-chip {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e6f0ff;
  color: #1a73e8;
}

.place-chip.part { background: #f6ffed; color: #52c41a; }
.place-chip.empty { background: #f5f5f5; color: #999; }

.place-card-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.place-tag {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
}

.tag-log { background: #1890ff; }
.tag-repair { background: #faad14; }

.place-item-time { flex-shrink: 0; color: #999; }
.place-item-text { color: #666; word-break: break-all; }

.place-card-none { font-size: 12px; color: #bbb; }

.place-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.place-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ebedf0;
}

.place-photo:hover { opacity: 0.85; }

.place-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed #f0f0f0;
  padding-top: 8px;
  margin-top: 2px;
  font-size: 12px;
  color: #999;
}

.place-card-link { color: #1a73e8; cursor: pointer; }
.place-card-link:hover { text-decoration: underline; }

/* ===== 场地详情弹窗 ===== */
.place-detail-head { margin-bottom: 16px; }

.place-detail-name { font-size: 16px; font-weight: 600; }

.place-detail-addr { font-size: 12px; color: #999; margin-top: 4px; }

.place-detail-stats { font-size: 12px; color: #666; margin-top: 6px; }

.place-detail-block { margin-bottom: 20px; }

.place-detail-block h5 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid #1a73e8;
}

.place-detail-table th { background: #fafafa; font-size: 12px; }
.place-detail-table td { font-size: 12px; }

.place-detail-empty { font-size: 12px; color: #999; }

.place-detail-item {
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.place-detail-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.place-detail-item-head b { color: #333; font-size: 13px; }

.place-detail-item-body {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== 场地日志：分组 + 场地卡片列表 ===== */
.sitelog-group { margin-bottom: 22px; }

.sitelog-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(90deg, #eef4fb 0%, #f7fafd 100%);
  border-left: 4px solid #1a3a5c;
  border-radius: 6px;
  margin-bottom: 12px;
}

.sitelog-group-name { font-weight: 600; font-size: 15px; color: #1a3a5c; }
.sitelog-group-meta { font-size: 12px; color: #8a94a6; }

.sitelog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: start;
  gap: 14px;
}

/* 卡片本体：白底 + 8px 圆角 + 柔和阴影，悬停轻微抬升 */
.sitelog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ebedf0;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sitelog-card:hover {
  transform: translateY(-2px);
  border-color: #1a73e8;
  box-shadow: 0 6px 16px rgba(26,115,232,0.16);
}

/* 无日志场地：弱化存在感，但仍可点开查看 */
.sitelog-card.is-empty {
  background: #fcfcfd;
  border-color: #f2f3f5;
  box-shadow: none;
}

.sitelog-card.is-empty:hover {
  border-color: #dfe3e8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.sitelog-card-head { display: flex; align-items: flex-start; gap: 8px; }

.sitelog-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1a3a5c;
  line-height: 1.4;
}

.sitelog-card.is-empty .sitelog-card-name { font-weight: 500; color: #97a0ac; }

.sitelog-count {
  flex: none;
  padding: 0 8px;
  font-size: 12px;
  line-height: 18px;
  border-radius: 9px;
  color: #1a73e8;
  background: #eaf2fe;
  white-space: nowrap;
}

.sitelog-count.is-zero { color: #b6bcc6; background: #f4f5f7; }

.sitelog-contract {
  align-self: flex-start;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #6b7684;
  background: #f5f7fa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sitelog-card.is-empty .sitelog-contract { color: #b6bcc6; background: #fafbfc; }

.sitelog-card-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #f0f1f3;
}

.sitelog-latest {
  margin-bottom: 4px;
  font-size: 12px;
  color: #9aa3ae;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sitelog-latest-text {
  font-size: 13px;
  color: #445;
  line-height: 1.5;
  max-height: 40px;
  overflow: hidden;
}

.sitelog-card.is-empty .sitelog-latest-text { color: #b6bcc6; }

/* 照片缩略图：固定行高 3 列，卡片高度不随照片数量增长 */
.sitelog-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 88px;
  gap: 6px;
  margin-top: 10px;
}

.sitelog-photo {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.sitelog-photos img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #f0f1f3;
  background: #f5f6f8;
}

/* 「+N」剩余张数角标：压最后一张图 */
.sitelog-photo-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 6px;
}

.sitelog-footer { margin-top: 8px; font-size: 12px; color: #9aa3ae; }

/* ===== 维修日报：关键字聚合搜索 ===== */
.kw-agg-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 2px 0 16px;
  padding: 14px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(234,242,254,.85) 0%, rgba(244,249,255,.6) 100%);
  border: 1px solid rgba(26,115,232,.18);
  backdrop-filter: blur(6px);
}

.kw-agg-title { font-size: 15px; color: #1a3a5c; }
.kw-agg-title b { color: #1a73e8; }
.kw-agg-icon { margin-right: 4px; }

.kw-agg-meta { font-size: 13px; color: #5b6b7f; }
.kw-agg-meta b { color: #1a73e8; font-size: 14px; }
.kw-agg-warn { margin-left: 8px; color: #c47b16; font-size: 12px; }

.kw-loading { padding: 40px 20px; text-align: center; color: #6b7b90; font-size: 14px; }

/* 双列卡片：左右各一个聚合结果，窄屏自动堆叠 */
.kw-agg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .kw-agg-grid { grid-template-columns: 1fr; }
}

.kw-agg-card {
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(26,115,232,.14);
  box-shadow: 0 2px 10px rgba(26,58,92,.07);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.kw-card-head {
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #1a3a5c;
  background: linear-gradient(90deg, rgba(234,242,254,.7), rgba(245,250,255,.4));
  border-bottom: 1px solid rgba(26,115,232,.1);
}

.kw-card-body { padding: 8px; max-height: 460px; overflow-y: auto; }

.kw-empty { padding: 30px 10px; text-align: center; color: #a3acb8; font-size: 13px; }

.kw-row { padding: 9px 12px; border-radius: 8px; cursor: pointer; transition: background .15s ease; }
.kw-row:hover { background: rgba(26,115,232,.07); }
.kw-row.active { background: rgba(26,115,232,.11); }

.kw-row-main { display: flex; align-items: center; gap: 8px; }

.kw-rank {
  flex: none;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
  color: #8a97a8;
  background: #eef2f7;
  border-radius: 50%;
}
.kw-row:nth-child(-n+3) .kw-rank { color: #fff; background: #1a73e8; }

.kw-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: #2a3a4f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kw-badge {
  flex: none;
  padding: 1px 9px;
  font-size: 12px;
  color: #1a73e8;
  background: #eaf2fe;
  border-radius: 10px;
}

.kw-row-sub {
  margin: 4px 0 0 28px;
  font-size: 12px;
  color: #8a97a8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 明细区 */
.kw-detail-wrap { margin-top: 18px; }

.kw-detail-head {
  padding: 9px 14px;
  font-size: 13px;
  color: #1a3a5c;
  background: linear-gradient(90deg, #eef4fb, #f7fafd);
  border-left: 4px solid #1a73e8;
  border-radius: 6px;
  margin-bottom: 10px;
}

.kw-detail-item {
  border: 1px solid #ebedf0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.8);
}

.kw-detail-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #5b6b7f;
  margin-bottom: 8px;
}

.kw-detail-time { color: #1a73e8; font-weight: 500; }

.kw-tag { padding: 1px 8px; font-size: 11px; border-radius: 4px; }
.kw-tag.done { color: #389e0d; background: #f0f9e8; }
.kw-tag.doing { color: #d48806; background: #fff7e6; }

.kw-detail-line { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: #445; }
.kw-detail-desc { font-size: 13px; color: #445; line-height: 1.7; margin-bottom: 4px; }
.kw-detail-desc b { color: #2a3a4f; }

.kw-mark { background: #fff3a8; color: inherit; padding: 0 2px; border-radius: 3px; }

/* ===== 故障大类：日报卡片标签 ===== */
.fault-type-tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 500;
}
.ft-tag-硬件 { color: #1a5bb0; background: #e3effd; border: 1px solid #bcd9f7; }
.ft-tag-电器 { color: #c0392b; background: #fdeae8; border: 1px solid #f6cbc6; }
.ft-tag-软件 { color: #2c8a47; background: #e8f7ee; border: 1px solid #c4e8d2; }

/* ===== 故障大类：详情弹窗可编辑 chips ===== */
.ft-edit-chips { display: inline-flex; gap: 8px; vertical-align: middle; }

.ft-edit-chip {
  display: inline-block;
  padding: 2px 14px;
  font-size: 13px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.ft-edit-chip.ft-chip-硬件 { color: #1a5bb0; background: #f2f8ff; border-color: #c5ddf7; }
.ft-edit-chip.ft-chip-电器 { color: #c0392b; background: #fff5f4; border-color: #f2ccc7; }
.ft-edit-chip.ft-chip-软件 { color: #2c8a47; background: #f1faf4; border-color: #c6e8d3; }

.ft-edit-chip.active.ft-chip-硬件 { color: #fff; background: #1a73e8; border-color: #1a73e8; }
.ft-edit-chip.active.ft-chip-电器 { color: #fff; background: #ea4335; border-color: #ea4335; }
.ft-edit-chip.active.ft-chip-软件 { color: #fff; background: #34a853; border-color: #34a853; }

/* ===== 维修日报：横向条件筛选面板（条件横向排布、自动换行，多条件同时生效）===== */
.lf-panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(238,245,252,.75) 0%, rgba(247,250,253,.55) 100%);
  border: 1px solid rgba(26,115,232,.15);
  backdrop-filter: blur(6px);
}

.lf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.lf-label {
  flex: none;
  min-width: 52px;
  font-size: 13px;
  font-weight: 600;
  color: #1a3a5c;
  text-align: right;
}

.lf-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 可搜索下拉：横向布局下固定宽度（覆盖默认 inline-block） */
.lf-control .searchable-select {
  display: block;
  width: 200px;
  min-width: 0;
}

.lf-select, .lf-date, .lf-text {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d9e4;
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  font-size: 13px;
  color: #333;
}

.lf-select { width: 170px; }
.lf-date { width: 150px; }
.lf-text { flex: none; width: 230px; }
.lf-select:focus, .lf-date:focus, .lf-text:focus { border-color: #1a73e8; outline: none; }

.lf-dash { font-size: 12px; color: #98a2b0; }

/* ===== 维修日报：记录视图 / 场地视图 分段切换 ===== */
.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: rgba(123,143,161,.14);
  border: 1px solid rgba(123,143,161,.2);
}
.vs-btn {
  border: none;
  background: transparent;
  padding: 5px 16px;
  font-size: 13px;
  color: #5b6b7f;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
}
.vs-btn:hover { color: #1a3a5c; }
.vs-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #7B8FA1, #9BAFC1);
  box-shadow: 0 1px 4px rgba(90,110,130,.35);
}

/* ===== 全局：所有数据表格鼠标悬停高亮当前行 ===== */
table tbody tr { transition: background-color .12s ease; }
table tbody tr:hover > td {
  background-color: #8fbdf0 !important;
}
/* 含交互操作的表格（.table-wrap 内为列表）指针提示；纯展示表格保持默认 */
.table-wrap table tbody tr { cursor: default; }

/* 场地库存表：每个单元格带横线（表头上下、数据行底部） */
.sl-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sl-stock-table th,
.sl-stock-table td {
  border-bottom: 1px solid #e8edf2;
}
.sl-stock-table thead tr {
  background: #fafafa;
}
.sl-stock-table thead th {
  border-top: 1px solid #e8edf2;
}

/* 单条件一键清除按钮 */
.lf-clear {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: #98a2b0;
  background: rgba(152,162,176,.14);
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.lf-clear:hover {
  color: #fff;
  background: #ea4335;
}

/* 操作行独占一行；按钮自动换行，窄屏不挤压 */
.lf-row:has(.lf-op) { flex-basis: 100%; }
.lf-op { flex-wrap: wrap; row-gap: 8px; }
.lf-check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #5b6b7f; }
.lf-check input { width: 15px; height: 15px; }

@media (max-width: 720px) {
  .lf-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lf-label { text-align: left; min-width: 0; }
  .lf-control { width: 100%; }
  .lf-select, .lf-date, .lf-text, .lf-control .searchable-select { width: 100%; }
}

/* ===== 场地分析 ===== */
.pa-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e8e8e8;
}

.pa-tab {
  padding: 10px 18px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
}

.pa-tab:hover { color: #1a73e8; }

.pa-tab.active {
  color: #1a73e8;
  font-weight: 600;
  border-bottom-color: #1a73e8;
}

.pa-tab .pa-tab-sub {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #999;
}

/* 可排序列：用蓝色底色明确标出可点击区域 */
.pa-th-sort {
  cursor: pointer;
  user-select: none;
  background: #e8f1ff;
  color: #1a73e8;
  box-shadow: inset 0 -2px 0 #bcd6ff;
}
.pa-th-sort:hover { background: #d6e7ff; color: #0b57d0; }
.pa-th-sort.active { background: #d6e7ff; color: #0b57d0; box-shadow: inset 0 -2px 0 #1a73e8; }
.pa-th-sort .pa-arrow { font-size: 12px; color: #1a73e8; font-weight: 700; }
.pa-th-sort.active .pa-arrow { color: #0b57d0; }

.pa-empty { text-align: center; padding: 36px 20px; color: #999; font-size: 13px; }

.pa-detail-section { margin-top: 18px; }
.pa-detail-section h5 { font-size: 14px; font-weight: 600; color: #1a3a5c; margin-bottom: 8px; }

.pa-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }

.pa-chip {
  background: #f5f7fa;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  color: #666;
}

.pa-chip b { display: block; font-size: 16px; color: #1a3a5c; margin-top: 2px; }
