/* ============================================
   星舟管理后台 - 主样式表
   设计风格：卡片式扁平化 / 简约现代
   ============================================ */

/* ---------- CSS 变量（亮色主题） ---------- */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --primary-bg: #eef2ff;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;

  --info: #3b82f6;
  --info-bg: #eff6ff;
  --info-text: #1e40af;

  /* 布局 */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

  /* 动画 */
  --transition-fast: .15s ease;
  --transition-normal: .25s ease;
  --transition-slow: .4s cubic-bezier(.16,1,.3,1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: #f5f7fa;
  color: #334155;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== 布局结构 ========== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: #1e293b;
  color: #e2e8f0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), width var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.sidebar-brand span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  display: block;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-mini:hover { background: rgba(255,255,255,.06); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #64748b; }

/* ---------- 主内容区 ---------- */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #475569;
  transition: all var(--transition-fast);
}

.menu-toggle:hover { background: #e2e8f0; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.breadcrumb .current {
  color: #1e293b;
  font-weight: 600;
}

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

.topbar-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #64748b;
  position: relative;
  transition: all var(--transition-fast);
}

.topbar-btn:hover { background: #f1f5f9; color: #334155; }

.topbar-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ---------- 页面内容 ---------- */
.page-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.page-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== 卡片组件 ========== */

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid #e8ecf1;
  padding: 22px 24px;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-flat:hover {
  box-shadow: none;
  transform: translateY(-2px);
  border-color: #d4dce8;
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  font-size: 17px;
}

.card-extra { font-size: 13px; color: var(--primary); cursor: pointer; font-weight: 500; }
.card-extra:hover { text-decoration: underline; }

/* ========== 统计卡片 ========== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid #e8ecf1;
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition-normal);
  cursor: default;
}

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

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

.stat-icon.purple { background: var(--primary-bg); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 12.5px; color: #64748b; font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
}
.stat-change.up { background: var(--success-bg); color: var(--success-text); }
.stat-change.down { background: var(--danger-bg); color: var(--danger-text); }

/* ========== 按钮组件 ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(79,70,229,.35); }

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

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

.btn-outline {
  background: transparent;
  color: #475569;
  border: 1px solid #d1d5db;
}
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-ghost {
  background: transparent;
  color: #64748b;
  padding: 6px 12px;
}
.btn-ghost:hover { background: #f1f5f9; color: #334155; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ========== 表格组件 ========== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid #e8ecf1;
}

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

.data-table th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e8ecf1;
  white-space: nowrap;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }

.table-cell-bold { font-weight: 600; color: #1e293b; }
.text-muted { color: #94a3b8; font-size: 12.5px; }

/* 表格内操作按钮组 */
.action-group { display: flex; align-items: center; gap: 4px; }

/* ========== 表单组件 ========== */

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: #334155;
  background: #fff;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.form-input::placeholder { color: #9ca3af; }

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 开关 */
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

.switch input { display: none; }

.switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  transition: background var(--transition-fast);
}

.switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition-fast);
}

.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::after { transform: translateX(18px); }

/* 文件上传区域 */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: #fafbfc;
}

.upload-zone:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.upload-zone .upload-icon {
  font-size: 36px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 13px;
  color: #64748b;
}

.upload-zone p span {
  color: var(--primary);
  font-weight: 600;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

/* ========== 标签/徽章 ========== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ========== 空状态 ========== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.empty-state .empty-icon {
  font-size: 52px;
  margin-bottom: 12px;
  opacity: .6;
}

.empty-state h3 {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 18px;
}

/* ========== 分页 ========== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 0 0;
}

.pagination button {
  min-width: 34px;
  height: 34px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  transition: all var(--transition-fast);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.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: .4;
  cursor: not-allowed;
}

/* ========== 搜索与筛选栏 ========== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  background: #fff;
  color: #334155;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #94a3b8;
}

.filter-select {
  padding: 9px 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: #475569;
  background: #fff;
  cursor: pointer;
  min-width: 130px;
}

.filter-select:focus { border-color: var(--primary); }

/* ========== 弹窗/模态框 ========== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.97);
  transition: transform var(--transition-normal);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: #e2e8f0; color: #334155; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #f1f5f9;
}

/* ========== 提示消息 ========== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  min-width: 280px;
  animation: toastIn .3s ease forwards;
  border-left: 4px solid #64748b;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

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

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

/* ========== 图表容器 ========== */

.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-container.tall { height: 340px; }

/* ========== 两栏布局 ========== */

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ========== 详情展示 ========== */

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px dashed #f1f5f9;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.detail-value {
  flex: 1;
  font-size: 13.5px;
  color: #1e293b;
  line-height: 1.6;
}

/* ========== Tab 切换 ========== */

.tabs {
  display: flex;
  border-bottom: 2px solid #e8ecf1;
  margin-bottom: 20px;
  gap: 0;
}

.tab-item {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-item:hover { color: var(--primary); }

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ========== 进度条 ========== */

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e8ecf1;
  border-radius: 4px;
  overflow: hidden;
}

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

/* ========== 响应式适配 ========== */

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,.2);
  }

  .main-area { margin-left: 0; }
  .menu-toggle { display: flex; }

  .page-content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box { min-width: unset; }
  .filter-select { min-width: unset; width: 100%; }
}

@media (max-width: 480px) {
  html { font-size: 13px; }
  .stat-value { font-size: 22px; }
  .card { padding: 16px 18px; }
}

/* ---------- 移动端遮罩 ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ---------- 页面入场动画 ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp .4s ease both;
}

.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }
