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

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #1e40af;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0891b2;
  --info-bg: #cffafe;
  --purple: #7c3aed;
  --purple-bg: #ede9fe;
}

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

/* ==================== 布局 ==================== */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 24px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
  padding: 8px 24px 4px;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; border-left-color: #60a5fa; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid #334155;
  font-size: 12px;
  color: #64748b;
}

.main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.user-menu:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.user-name { font-size: 14px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-light); }

.content { flex: 1; padding: 24px; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ==================== 统计卡片 ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-info { flex: 1; }
.stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--text-lighter); margin-top: 4px; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.orange { background: #fed7aa; color: #ea580c; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.cyan { background: #cffafe; color: #0891b2; }

/* ==================== 表格 ==================== */
table { width: 100%; border-collapse: collapse; }
.table-wrapper { overflow-x: auto; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
tr:hover td { background: #f8fafc; }
.table-link { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 500; }
.table-link:hover { text-decoration: underline; }

/* ==================== 徽章 ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.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-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray { background: #f1f5f9; color: var(--text-light); }
.badge-blue { background: #dbeafe; color: #2563eb; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border-dark); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px 10px; }
.btn-group { display: flex; gap: 8px; }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-label .required { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ==================== 筛选栏 ==================== */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-item label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.filter-item select, .filter-item input {
  padding: 6px 10px;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font-size: 13px;
  min-width: 120px;
  outline: none;
}
.filter-item select:focus, .filter-item input:focus { border-color: var(--primary-light); }

/* ==================== 进度条 ==================== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning); }

/* ==================== 标签页 ==================== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ==================== 模态框 ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1000px; }
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==================== Toast ==================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none; /* 容器不拦截触摸事件 */
}
#toast-container .toast {
  pointer-events: auto; /* 单个toast可交互 */
}
.toast {
  background: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== 登录页 ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}
.login-title { font-size: 20px; font-weight: 700; color: var(--text); }
.login-subtitle { font-size: 14px; color: var(--text-light); margin-top: 4px; }

/* ==================== 时间线 ==================== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content { }
.timeline-time { font-size: 12px; color: var(--text-light); margin-bottom: 2px; }
.timeline-desc { font-size: 14px; }
.timeline-user { font-size: 12px; color: var(--text-lighter); }

/* ==================== 工具类 ==================== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }
.cursor-pointer { cursor: pointer; }

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .title { font-size: 16px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.empty-state .desc { font-size: 13px; }

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.pagination-info { font-size: 13px; color: var(--text-light); }
.pagination-buttons { display: flex; gap: 4px; }
.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.pagination-btn:hover { background: var(--bg); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==================== 详情页 ==================== */
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.detail-item { }
.detail-item-label { font-size: 12px; color: var(--text-light); margin-bottom: 2px; }
.detail-item-value { font-size: 14px; font-weight: 500; }

/* ==================== 图表 ==================== */
.chart-container { padding: 16px 0; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 100px; font-size: 13px; text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 24px; background: var(--bg); border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 12px; color: #fff; font-weight: 500; transition: width 0.3s; }
.bar-value { width: 60px; font-size: 13px; font-weight: 500; flex-shrink: 0; }

.donut-chart { display: flex; align-items: center; gap: 24px; justify-content: center; padding: 20px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ==================== 移动端响应式 ==================== */

/* 移动端侧边栏遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  /* 登录页适配 */
  .login-card {
    width: calc(100% - 32px);
    max-width: 400px;
    padding: 24px 20px;
    border-radius: 12px;
  }
  .login-logo .icon {
    width: 56px; height: 56px;
    font-size: 28px;
  }
  .login-title { font-size: 18px; }

  /* 侧边栏改为抽屉模式 */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.sidebar-collapsed {
    transform: translateX(-100%);
    width: 240px;
  }
  .main, .main.sidebar-collapsed {
    margin-left: 0;
  }

  /* 顶栏调整 */
  .topbar {
    padding: 0 12px;
    height: 52px;
  }
  .topbar-title {
    font-size: 15px;
  }
  .sidebar-toggle {
    font-size: 20px;
    padding: 6px 8px;
  }

  /* 隐藏桌面端搜索栏，改为搜索按钮 */
  .global-search {
    display: none;
  }
  .mobile-search-btn {
    display: flex;
    font-size: 18px;
    padding: 6px 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 6px;
  }

  /* 用户菜单简化 */
  .user-menu > div:nth-child(2) {
    display: none;
  }
  .user-avatar {
    width: 32px; height: 32px;
    font-size: 14px;
  }

  /* 内容区域 */
  .content {
    padding: 12px;
  }

  /* 统计卡片单列 */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-value {
    font-size: 22px;
  }
  .stat-label {
    font-size: 11px;
  }

  /* 网格单列 */
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  /* 表格横向滚动 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }
  th, td {
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 按钮触控优化 */
  .btn {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 38px;
  }
  .btn-sm {
    min-height: 32px;
    padding: 6px 10px;
  }
  .btn-icon {
    min-height: 38px;
    min-width: 38px;
  }

  /* 模态框全屏 */
  .modal {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
    overflow-y: auto;
  }
  .modal-overlay {
    padding: 0;
  }
  .modal-header {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
    border-bottom: 1px solid var(--border);
  }
  .modal-header h3 {
    font-size: 15px;
  }
  .modal-body {
    padding: 12px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
  }

  /* 表单元素 */
  .form-input, .form-select, .form-textarea {
    font-size: 15px; /* iOS 防止缩放 */
    padding: 8px 12px;
  }

  /* 卡片 */
  .card {
    border-radius: 8px;
  }
  .card-body {
    padding: 12px;
  }

  /* 标签页 */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .tab {
    white-space: nowrap;
    padding: 8px 14px;
  }

  /* 工具栏 */
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .toolbar-left, .toolbar-right {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* 状态栏隐藏 */
  .statusbar {
    display: none;
  }

  /* 案件列表项 */
  .case-list-item {
    padding: 12px;
  }

  /* 分页 */
  .pagination {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  .pagination button {
    min-width: 36px;
    min-height: 36px;
    padding: 4px 8px;
  }

  /* 详情页 */
  .detail-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Toast 通知 */
  #toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: 100%;
  }

  /* 底部安全区 */
  .modal-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .sidebar {
    width: 200px;
  }
  .main {
    margin-left: 200px;
  }
}

/* 桌面端隐藏移动搜索按钮 */
.mobile-search-btn {
  display: none;
}

/* ==================== 桌面端优化 ==================== */

/* 大屏利用空间 - 1440px+ */
@media (min-width: 1440px) {
  .content { padding: 28px 32px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
  .stat-value { font-size: 32px; }
  .card-body { padding: 24px; }
  td { padding: 14px 20px; font-size: 14px; }
  th { padding: 12px 20px; }
  .sidebar { width: 260px; }
  .main { margin-left: 260px; }
}

/* 超大屏 - 1920px+ */
@media (min-width: 1920px) {
  .content { padding: 32px 48px; max-width: 1800px; }
  .stats-grid { gap: 24px; }
  .stat-value { font-size: 36px; }
  .stat-card { padding: 28px; }
  .modal { max-width: 700px; }
  .modal.modal-lg { max-width: 960px; }
  .modal.modal-xl { max-width: 1200px; }
}

/* 侧边栏折叠功能 */
.sidebar-collapsed { width: 64px; }
.sidebar-collapsed .sidebar-logo span,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .nav-item .nav-text,
.sidebar-collapsed .nav-item .nav-badge,
.sidebar-collapsed .sidebar-footer { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar-collapsed .nav-item .nav-icon { font-size: 20px; }
.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 20px 0; }
.main.sidebar-collapsed { margin-left: 64px; }

/* 侧边栏折叠按钮 */
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 18px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.sidebar-toggle:hover { background: var(--bg); }

/* 键盘快捷键提示 */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-family: "Consolas", "Monaco", monospace;
  background: #f1f5f9;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  color: var(--text-light);
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.nav-item .kbd-hint {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.nav-item:hover .kbd-hint { opacity: 0.6; }

/* 桌面端表格优化 */
.table-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) transparent;
}
.table-wrapper::-webkit-scrollbar { height: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

/* 桌面端行交互 */
tr { transition: background 0.1s; }
tbody tr { cursor: default; }

/* 右键菜单 */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 5000;
  min-width: 160px;
  padding: 4px;
  display: none;
}
.context-menu.show { display: block; }
.context-menu-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  transition: background 0.1s;
}
.context-menu-item:hover { background: var(--bg); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* 桌面端搜索框 */
.global-search {
  position: relative;
  width: 320px;
}
.global-search input {
  width: 100%;
  padding: 7px 12px 7px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #f8fafc;
  transition: all 0.15s;
}
.global-search input:focus {
  background: #fff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.global-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-lighter);
  pointer-events: none;
}
.global-search .search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* 桌面端状态栏 */
.statusbar {
  height: 28px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-light);
}
.statusbar-left, .statusbar-right { display: flex; align-items: center; gap: 12px; }
.statusbar-item { display: flex; align-items: center; gap: 4px; }
.statusbar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* 桌面端工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

/* 桌面端列表卡片悬浮效果 */
.case-list-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: all 0.15s;
  cursor: pointer;
}
.case-list-item:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
  transform: translateX(2px);
}

/* 桌面端面板分割 */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100%;
}
.split-panel-left, .split-panel-right {
  overflow-y: auto;
  padding: 20px;
}
.split-panel-left { border-right: 1px solid var(--border); }

/* 加载动画 */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 桌面端通知 */
.desktop-notification {
  position: fixed;
  bottom: 40px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3000;
  min-width: 320px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

