/* ============================================================
 * SOUL 管理后台 — 全局样式表（第3步版）
 * ============================================================
 *
 * 【文件作用】
 *   管理后台全部页面的视觉样式定义。
 *   采用纯 CSS3 实现，无任何第三方 CSS 框架依赖。
 *
 * 【对应 Word 文档】
 *   SOUL-ArchitectureDesign-ChineseV2.1.docx
 *   章节：管理后台（WEB 端）
 *
 * 【设计决策】
 *   - 深色侧边栏 + 浅色主区域（蓝紫主色调 #4F6EF7）
 *   - CSS 变量化：颜色/圆角/阴影等通过 :root 变量统一管理
 *   - 响应式：1200px 以下卡片变 2 列，768px 以下侧边栏收起
 *   - 无 CSS 预处理器：直接编写原生 CSS，降低构建工具依赖
 *
 * 【维护指引】
 *   - 修改颜色：在 :root 中调整 CSS 变量
 *   - 新增组件：在对应的注释分区下添加
 *   - 修改字体：在 body 中调整 font-family
 *   - 新增动画：在 @keyframes 区域定义
 *
 * 【开发人员后续需做事项】
 *   1. 可引入 CSS 变量主题切换（如浅色/深色模式）
 *   2. 为移动端 (<768px) 做更细致的响应式适配
 *   3. 考虑引入 CSS 预处理器（Sass/Less）以拆分大文件
 *   4. 添加打印样式 (print.css) 用于表格导出
 *
 * ============================================================ */

/* ============================================================
 * 一、CSS 变量（设计令牌）
 *    全局颜色、尺寸、阴影等设计参数集中管理
 * ============================================================ */
:root {
  /* -- 主色调 -- */
  --primary: #4F6EF7;          /* 主色：蓝紫 */
  --primary-dark: #3A56D4;     /* 主色深：悬停/按下 */
  --primary-light: #EEF1FE;    /* 主色浅：背景/高亮 */

  /* -- 辅助色 -- */
  --accent: #6C3FC5;           /* 强调色：紫 */
  --success: #22C55E;          /* 成功：绿 */
  --warning: #F59E0B;          /* 警告：黄 */
  --danger: #EF4444;           /* 危险：红 */
  --info: #3B82F6;             /* 信息：蓝 */

  /* -- 背景与边框 -- */
  --bg: #F4F6FB;               /* 页面背景 */
  --sidebar-bg: #1A1D2E;       /* 侧边栏背景 */
  --sidebar-text: #A0A8C0;     /* 侧边栏文字 */
  --sidebar-active: #4F6EF7;   /* 侧边栏激活色 */
  --card: #FFFFFF;             /* 卡片背景 */
  --border: #E5E9F2;           /* 边框色 */

  /* -- 文字颜色 -- */
  --text-primary: #1A1D2E;     /* 主文字 */
  --text-secondary: #6B7280;   /* 次要文字 */
  --text-muted: #9CA3AF;       /* 弱化文字 */

  /* -- 形状 -- */
  --radius: 10px;              /* 默认圆角 */

  /* -- 阴影 -- */
  --shadow: 0 2px 12px rgba(0,0,0,0.06);    /* 卡片阴影 */
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10); /* 弹窗阴影 */
}

/* ============================================================
 * 二、全局重置
 * ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  /* 禁止移动端双击缩放 */
  touch-action: manipulation;
}

a { text-decoration: none; color: inherit; }

/* 滚动条美化（WebKit 浏览器） */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
 * 三、登录页
 *    独立于主应用布局，全屏居中表单
 * ============================================================ */
.login-page {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  /* 渐变背景：深色 → 蓝紫 */
  background: linear-gradient(135deg, #1A1D2E 0%, #2D3262 50%, #4F6EF7 100%);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* 品牌标识区 */
.login-brand {
  text-align: center;
  margin-bottom: 40px;
}

.login-brand .logo {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 16px;
}

.login-brand h1 {
  color: #fff; font-size: 26px; font-weight: 700; letter-spacing: 2px;
}

.login-brand p {
  color: rgba(255,255,255,0.6); margin-top: 6px; font-size: 13px;
}

/* 登录表单卡片 */
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 44px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}

.login-card h2 {
  font-size: 20px; font-weight: 600; margin-bottom: 6px;
}

.login-card .sub {
  color: var(--text-secondary); font-size: 13px; margin-bottom: 32px;
}

/* 登录按钮 */
.btn-primary {
  width: 100%; height: 42px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.2s; font-family: inherit;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* 登录错误提示 */
.login-error {
  background: #FEE2E2; color: #DC2626; padding: 10px 14px;
  border-radius: 8px; font-size: 13px; margin-bottom: 18px; display: none;
}
.login-error.show { display: block; }

/* 登录加载动画 */
.login-loading {
  display: none; align-items: center; justify-content: center;
  gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-secondary);
}
.login-loading.show { display: flex; }

/* ============================================================
 * 四、主布局（侧边栏 + 内容区）
 * ============================================================ */
.app {
  display: flex; height: 100vh; flex-direction: row; overflow: hidden;
}

/* ============================================================
 * 五、侧边栏
 * ============================================================ */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; flex-shrink: 0;
  height: 100vh; overflow-y: auto;
  /* 过渡动画：响应式切换时平滑收放 */
  transition: width 0.3s ease, min-width 0.3s ease;
}

/* Logo 区域 */
.sidebar-logo {
  padding: 24px 20px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo .icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0;
}

.sidebar-logo span {
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px;
}

.sidebar-logo small {
  display: block; color: var(--sidebar-text); font-size: 11px; font-weight: 400;
}

/* 导航菜单 */
.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }

/* 导航分组标题 */
.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(160,168,192,0.5); font-weight: 600;
}

/* 导航项 */
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  color: var(--sidebar-text); cursor: pointer;
  margin: 1px 10px; border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.nav-item .nav-icon {
  font-size: 16px; width: 20px; text-align: center; flex-shrink: 0;
}

.nav-item .nav-label { font-size: 13px; font-weight: 500; }

/* 导航角标 */
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600;
}

/* 侧边栏底部用户信息 */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}

.sidebar-user .avatar {
  width: 34px; height: 34px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

.sidebar-user .info .name { color: #fff; font-size: 13px; font-weight: 500; }
.sidebar-user .info .role { color: var(--sidebar-text); font-size: 11px; }

.sidebar-user .logout-btn {
  margin-left: auto; color: var(--sidebar-text);
  font-size: 16px; cursor: pointer; padding: 4px; border-radius: 4px;
  transition: color 0.2s;
}
.sidebar-user .logout-btn:hover { color: #fff; }

/* ============================================================
 * 六、主内容区
 * ============================================================ */
.main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}

/* 顶部栏 */
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 16px; flex-shrink: 0;
}

.topbar-title {
  font-size: 16px; font-weight: 600; flex: 1;
  /* 过长文字截断 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-actions {
  display: flex; align-items: center; gap: 12px;
}

.topbar-actions .icon-btn {
  width: 36px; height: 36px; border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.topbar-actions .icon-btn:hover { background: var(--primary-light); color: var(--primary); }

.topbar-breadcrumb { font-size: 12px; color: var(--text-muted); }
.topbar-breadcrumb span { color: var(--text-secondary); }

/* 内容滚动区域 */
.content { flex: 1; overflow-y: auto; padding: 24px 28px; }

/* ============================================================
 * 七、统计卡片
 *    仪表盘顶部的 4 个数据概览卡片
 * ============================================================ */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 28px;
}

.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 18px;
  /* 微交互 */
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

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

.stat-card .stat-info .label {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 6px;
}

.stat-card .stat-info .value {
  font-size: 26px; font-weight: 700; line-height: 1;
}

.stat-card .stat-info .trend {
  font-size: 11px; color: var(--success); margin-top: 4px;
}

/* ============================================================
 * 八、通用卡片
 *    列表页/表单页的内容容器
 * ============================================================ */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

.card-header h3 { font-size: 15px; font-weight: 600; }

.card-body { padding: 24px; }

/* ============================================================
 * 九、搜索栏和工具栏
 *    表格上方的筛选条件区域
 * ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}

.search-box {
  flex: 1; max-width: 320px; position: relative;
}

.search-box input {
  width: 100%; height: 36px; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0 14px 0 36px;
  font-size: 13px; outline: none; font-family: inherit;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary); }

/* 搜索图标（伪元素实现） */
.search-box::before {
  content: '\1F50D'; position: absolute; left: 11px; top: 9px;
  font-size: 13px; pointer-events: none;
}

.toolbar-right { margin-left: auto; display: flex; gap: 10px; }

.toolbar select {
  height: 36px; padding: 0 12px; cursor: pointer; font-family: inherit;
  font-size: 13px; border: 1.5px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--text-secondary); outline: none;
  /* 自定义下拉箭头 */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

/* ============================================================
 * 十、按钮系统
 * ============================================================ */
.btn {
  height: 34px; padding: 0 16px; border-radius: 7px;
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s; font-family: inherit; white-space: nowrap;
}

.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }

/* 按钮变体 */
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-dark); }

.btn-outline {
  background: #fff; border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16A34A; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #D97706; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ============================================================
 * 十一、表单元素
 * ============================================================ */
.form-group { margin-bottom: 18px; }

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

/* 统一输入框/下拉/文本域样式 */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; height: 38px;
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 0 12px; font-size: 13px; outline: none;
  font-family: inherit; color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-group textarea {
  height: 80px; padding: 10px 12px; resize: vertical;
  line-height: 1.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}

/* 禁用状态 */
.form-group input:disabled,
.form-group select:disabled {
  cursor: not-allowed; opacity: 0.7;
}

.form-group .hint {
  font-size: 11px; color: var(--text-muted); margin-top: 5px;
}

/* 两列表单布局 */
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* ============================================================
 * 十二、数据表格
 * ============================================================ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

/* 表头 */
table th {
  padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  /* 用户无法选中表头文字 */
  user-select: none;
}

/* 数据行 */
table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}

/* 最后一行不显示底部边框（与卡片底部保持一致） */
table tr:last-child td { border-bottom: none; }

/* 悬停行背景 */
table tr:hover td { background: #FAFBFF; }

/* 操作列 */
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
 * 十三、状态徽标
 *    表格中展示状态的小标签
 * ============================================================ */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 600; gap: 4px;
  white-space: nowrap;
}

.badge::before { content: '\25CF'; font-size: 8px; }

.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-danger  { background: #FEE2E2; color: #DC2626; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-info    { background: #DBEAFE; color: #2563EB; }
.badge-gray    { background: #F3F4F6; color: #6B7280; }
.badge-purple  { background: #EDE9FE; color: #7C3AED; }

/* ============================================================
 * 十四、分页器
 * ============================================================ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border); font-size: 13px;
}

.pagination .page-info { color: var(--text-secondary); }

.page-btns { display: flex; gap: 6px; }

.page-btn {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px;
  border: 1.5px solid var(--border); background: #fff;
  color: var(--text-secondary); transition: all 0.15s;
  user-select: none;
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ============================================================
 * 十五、弹窗系统
 * ============================================================ */

/* 遮罩层 */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }

/* 弹窗内容 */
.modal {
  background: #fff; border-radius: 14px;
  width: 480px; max-width: 90vw; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  /* 入场动画 */
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.94) translateY(-10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  /* 弹窗滚动时标题固定 */
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 14px 14px 0 0;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  font-size: 20px; cursor: pointer; color: var(--text-muted);
  padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--text-primary); }

.modal-body { padding: 24px; }

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

/* ============================================================
 * 十六、文件上传区域
 *    点击或拖拽上传安装包的区域
 *
 * 【待优化】
 *   - 添加拖拽事件监听（dragover/drop）
 *   - 添加文件类型图标预览
 *   - 添加上传进度条
 * ============================================================ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }

.upload-zone .upload-icon { font-size: 36px; margin-bottom: 10px; }

.upload-zone p { color: var(--text-secondary); font-size: 13px; margin-bottom: 6px; }

.upload-zone small { color: var(--text-muted); font-size: 12px; }

/* 拖拽悬停效果 */
.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  border-style: solid;
}

/* 文件信息预览条 */
.file-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--primary-light);
  border-radius: 8px; margin-top: 10px;
  font-size: 13px; color: var(--primary); display: none;
}
.file-info.show { display: flex; }

/* 上传进度条 */
.upload-progress {
  margin-top: 10px; display: none;
}
.upload-progress.active { display: block; }

.upload-progress-bar {
  height: 8px; background: var(--primary-light); border-radius: 4px;
  overflow: hidden; position: relative;
}
.upload-progress-bar-fill {
  height: 100%; background: var(--primary); border-radius: 4px;
  width: 0%; transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 4px; text-align: center;
}

/* ============================================================
 * 十七、页面切换
 *    通过 .active class 控制页面显示/隐藏
 * ============================================================ */
.page-view { display: none; }
.page-view.active { display: block; }

/* ============================================================
 * 十八、图表（仪表盘）
 *
 * 【待替换】
 *   当前为静态 SVG 柱状图占位。
 *   接入真实图表库后移除此部分样式。
 * ============================================================ */
.chart-bars {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 20px 24px 0; width: 100%; height: 100%;
}

.bar {
  border-radius: 4px 4px 0 0; background: var(--primary);
  opacity: 0.7; flex: 1; transition: height 0.3s;
}

/* ============================================================
 * 十九、日志记录行样式
 *    登录记录的 ID 列用等宽字体
 * ============================================================ */
.log-row td:first-child {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 12px; color: var(--text-muted);
}

/* ============================================================
 * 二十、平台图标
 * ============================================================ */
.platform-icon { font-size: 18px; }

/* ============================================================
 * 二十一、空状态
 *     无数据时的占位提示
 * ============================================================ */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}

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

/* ============================================================
 * 二十二、Toast 通知
 *     右上角浮动消息，自动消失
 * ============================================================ */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  /* 防止遮挡点击 */
  pointer-events: none;
}

.toast {
  background: #1A1D2E; color: #fff; padding: 12px 18px;
  border-radius: 10px; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  animation: toastIn 0.25s ease;
  max-width: 360px;
  /* Toast 自身可交互（关闭按钮等） */
  pointer-events: auto;
}

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Toast 类型图标 */
.toast.success::before { content: '\2705'; }
.toast.error::before   { content: '\274C'; }
.toast.info::before    { content: '\2139\FE0F'; }

/* ============================================================
 * 二十三、加载状态
 * ============================================================ */

/* 全局加载遮罩 */
.loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(255,255,255,0.7); z-index: 9998;
  align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }

/* 旋转加载器 */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
 * 二十四、响应式布局
 *
 * 断点策略：
 *   > 1200px — 完整布局，统计卡片 4 列
 *   768~1200px — 统计卡片 2 列，侧边栏正常
 *   < 768px — 侧边栏收起为图标模式，统计卡片 1 列
 * ============================================================ */

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* 侧边栏收起：只显示图标 */
  .sidebar { width: 60px; min-width: 60px; }

  /* 隐藏文字内容 */
  .sidebar-logo span,
  .sidebar-logo small,
  .nav-label,
  .nav-section-title,
  .sidebar-user .info { display: none; }

  .nav-item { justify-content: center; padding: 10px; }

  .sidebar-user { justify-content: center; }

  /* 内容区适配 */
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
