/* 系统管理中心面板（在当前工作页内全屏打开）
   样式统一以 #systemPanel 作作用域前缀（sp-），避免与工作页样式冲突 */

#systemPanel {
  position: fixed; inset: 0; z-index: 3000;
  background: #eaf1f8; overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #334155;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#systemPanel.hidden { display: none; }
#systemPanel * { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 顶栏 ===== */
#systemPanel .sp-topbar {
  background: linear-gradient(135deg, #1a6da0, #14537a 60%, #0e3a54);
  color: #fff; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 4px 14px rgba(14,58,84,0.2);
}
#systemPanel .sp-topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
#systemPanel .sp-who { font-size: 12px; opacity: 0.85; margin-top: 2px; }
#systemPanel .sp-actions { display: flex; gap: 8px; }
#systemPanel .sp-btn-top {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  color: #fff; padding: 8px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; -webkit-appearance: none; white-space: nowrap;
}
#systemPanel .sp-btn-top:active { background: rgba(255,255,255,0.24); }

/* ===== 页签 ===== */
#systemPanel .sp-tabs {
  display: flex; gap: 6px; padding: 14px 14px 0;
  max-width: 860px; margin: 0 auto; width: 100%;
}
#systemPanel .sp-tab {
  flex: 1; padding: 10px 6px; border: 1.5px solid #e2e8f0; border-bottom: none;
  border-radius: 12px 12px 0 0; background: #f1f5f9; color: #64748b;
  font-size: 14px; font-weight: 600; cursor: pointer; -webkit-appearance: none;
}
#systemPanel .sp-tab.active {
  background: #fff; color: #1a6da0; border-color: #e2e8f0;
}

/* ===== 内容区 ===== */
#systemPanel .sp-wrap {
  max-width: 860px; margin: 0 auto; width: 100%;
  padding: 14px 14px calc(40px + env(safe-area-inset-bottom, 0px));
}
#systemPanel .sp-tabpage { background: transparent; }
#systemPanel .sp-card {
  background: #fff; border-radius: 14px;
  padding: 18px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid #e2e8f0;
}
#systemPanel .sp-card-title {
  font-size: 15px; font-weight: 700; color: #1a6da0;
  letter-spacing: 0.6px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 7px;
}
#systemPanel .sp-card-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #4da3dc; flex-shrink: 0;
}
#systemPanel .sp-card-desc { font-size: 12px; color: #64748b; margin-bottom: 12px; }

/* ===== 表格 ===== */
#systemPanel table.sp-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
#systemPanel .sp-tbl th {
  text-align: left; padding: 9px 8px; color: #64748b;
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
#systemPanel .sp-tbl td { padding: 9px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; white-space: nowrap; }
#systemPanel .sp-tbl tr:last-child td { border-bottom: none; }
#systemPanel .sp-tbl-wrap { overflow-x: auto; }
#systemPanel .sp-empty-row { text-align: center; color: #64748b; padding: 16px 0 !important; }

/* 窄屏下表格保持可读：横向滚动而不是把列压成竖排 */
#systemPanel #spPageCounty table.sp-tbl { min-width: 480px; }
#systemPanel #spPageSite table.sp-tbl { min-width: 560px; }
#systemPanel #spPageUser table.sp-tbl { min-width: 680px; }

/* ===== 标签 ===== */
#systemPanel .sp-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
#systemPanel .sp-tag-on  { background: #d5f5e3; color: #145c30; }
#systemPanel .sp-tag-off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
#systemPanel .sp-tag-role-system { background: #fef3c7; color: #92400e; }
#systemPanel .sp-tag-role-county { background: #e8f4fd; color: #14537a; }
#systemPanel .sp-tag-role-operator { background: #f1f5f9; color: #334155; }

/* ===== 按钮 ===== */
#systemPanel .sp-btn {
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  border: none; cursor: pointer; font-weight: 500;
  -webkit-appearance: none; white-space: nowrap;
}
#systemPanel .sp-btn:active { opacity: 0.75; }
#systemPanel .sp-btn-primary { background: #2980b9; color: #fff; }
#systemPanel .sp-btn-edit  { background: #fef3c7; color: #92400e; }
#systemPanel .sp-btn-reset { background: #e8f4fd; color: #14537a; }
#systemPanel .sp-btn-del   { background: #fadbd8; color: #e74c3c; }
#systemPanel .sp-btn-off   { background: #f1f5f9; color: #334155; }
#systemPanel .sp-btn-on    { background: #d5f5e3; color: #145c30; }
#systemPanel .sp-btn-table { padding: 5px 9px; border-radius: 6px; font-size: 12px; margin-right: 4px; }

/* ===== 表单 ===== */
#systemPanel .sp-form-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 14px; margin: 12px 0;
}
#systemPanel .sp-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: #64748b; margin-bottom: 3px;
}
#systemPanel .sp-field input, #systemPanel .sp-field select {
  width: 100%; padding: 9px 10px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; background: #fff; -webkit-appearance: none;
}
#systemPanel .sp-field input:focus, #systemPanel .sp-field select:focus { outline: none; border-color: #4da3dc; }
#systemPanel .sp-form-actions { display: flex; gap: 8px; margin-top: 2px; align-items: flex-end; }
#systemPanel .sp-inline-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
}
#systemPanel .sp-inline-row input, #systemPanel .sp-inline-row select {
  padding: 9px 10px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; background: #fff; -webkit-appearance: none;
}
#systemPanel .sp-filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
#systemPanel .sp-filter-row select {
  padding: 8px 10px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; background: #fff; -webkit-appearance: none;
}
#systemPanel .sp-form-hint { font-size: 11px; color: #64748b; margin-top: 4px; }
#systemPanel .sp-hidden { display: none !important; }

/* ===== 提示浮层 ===== */
#systemPanel .sp-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: rgba(15,23,42,0.88); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 20px; z-index: 3100;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
#systemPanel .sp-toast.show { opacity: 1; }
