/* 悟空 CRM - 公共样式 */

/* ========== CSS 变量定义 ========== */
:root {
  /* 主色调 - Trust Blue */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* 辅助色 */
  --secondary-500: #3b82f6;
  --accent-500: #f97316;
  --accent-600: #ea580c;

  /* 中性色 */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* 功能色 */
  --success-500: #22c55e;
  --success-600: #16a34a;
  --warning-500: #eab308;
  --warning-600: #ca8a04;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --info-500: #06b6d4;
  --info-600: #0891b2;

  /* 间距 */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 64px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* 圆角 */
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* 字体 */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--gray-50);
}

body {
  font-family: var(--font-body);
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  /* 防止页面跳转时白屏闪烁 */
  opacity: 1;
  visibility: visible;
}

/* 确保页面加载过程中不显示空白 */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--gray-50);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-900);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

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

a:hover {
  color: var(--primary-700);
}

/* ========== 布局框架 ========== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 - 固定定位确保始终可见 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: var(--gray-100);
  z-index: 50;
  transition: width var(--transition-slow);
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
}

/* 确保侧边栏内容不会溢出 */
.sidebar-nav {
  padding: 1rem 0.75rem;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: var(--header-height);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.sidebar-logo svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

/* 显示 logo 文字 - 仅文字无图标 */
.sidebar-logo span {
  display: block;
}

.sidebar-logo svg {
  display: none;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  color: var(--gray-300);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 0.25rem;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: var(--primary-600);
  color: white;
}

.nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-item-text {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar.collapsed .nav-item-text {
  display: none;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
  min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* 顶部栏 */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 搜索框 */
.search-box {
  position: relative;
}

.search-box input {
  width: 300px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-500);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-100);
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

/* 用户菜单 */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-menu:hover {
  background: var(--gray-100);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
}

.user-role {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* 通知图标 */
.notification-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.notification-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 8px;
  height: 8px;
  background: var(--danger-500);
  border-radius: 50%;
  border: 2px solid white;
}

/* 页面内容 */
.page-content {
  padding: 1.5rem;
}

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

.page-actions {
  display: flex;
  gap: 0.75rem;
}

/* ========== 卡片组件 - 高端美化版 ========== */
.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.1), 0 4px 6px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--gray-250, #e5e7eb);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}

.card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: 0.025em;
}

.card-body {
  padding: 1.75rem;
}

.card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(180deg, #f8fafc 0%, #fafbfc 100%);
}

/* 紧凑卡片 */
.card-compact .card-header,
.card-compact .card-body,
.card-compact .card-footer {
  padding: 1rem 1.25rem;
}

/* 无边框卡片 */
.card-borderless {
  border: none;
  box-shadow: 0 6px 10px -2px rgba(0, 0, 0, 0.08), 0 3px 5px -3px rgba(0, 0, 0, 0.06);
}

/* 统计卡片 - 高端美化版 */
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.stat-card:hover {
  box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.12), 0 6px 10px -4px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
  border-color: var(--primary-200);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-fast);
}

.stat-card:hover .stat-icon {
  transform: scale(1.05);
}

.stat-icon.primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
}

.stat-icon.success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.stat-icon.warning {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: white;
}

.stat-icon.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stat-icon.info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
  letter-spacing: -0.025em;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

.stat-trend.up {
  color: var(--success-600);
}

.stat-trend.down {
  color: var(--danger-600);
}

.stat-trend svg {
  width: 16px;
  height: 16px;
}

/* ========== 按钮组件 - 高端美化版 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 主按钮 - 渐变背景 + 阴影 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2);
}

/* 次按钮 - 精致边框 */
.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* 成功按钮 */
.btn-success {
  background: linear-gradient(135deg, var(--success-600) 0%, var(--success-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--success-700) 0%, var(--success-800) 100%);
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

/* 危险按钮 */
.btn-danger {
  background: linear-gradient(135deg, var(--danger-600) 0%, var(--danger-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-700) 0%, var(--danger-800) 100%);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* 警告按钮 */
.btn-warning {
  background: linear-gradient(135deg, var(--warning-600) 0%, var(--warning-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(234, 179, 8, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, var(--warning-700) 0%, var(--warning-800) 100%);
  box-shadow: 0 4px 8px rgba(234, 179, 8, 0.4);
  transform: translateY(-2px);
}

/* 描边按钮 */
.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border: 1.5px solid var(--primary-600);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-700);
  color: var(--primary-700);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

/* 小按钮 */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* 大按钮 */
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

/* 图标按钮 */
.btn-icon {
  padding: 0.625rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0.5rem;
}

/* 禁用状态 */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 按钮组 */
.btn-group {
  display: inline-flex;
  gap: 0.5rem;
}

.btn-group .btn {
  border-radius: var(--radius-md);
}

/* ========== 表格组件 - 高端美化版 ========== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--gray-200);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

/* 表头样式 - 增强视觉层次 */
.data-table thead,
.table thead {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--gray-200);
}

.data-table th,
.table th {
  padding: 1.125rem 1.5rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.075em;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  position: relative;
}

.data-table th:first-child,
.table th:first-child {
  border-top-left-radius: var(--radius-lg);
}

.data-table th:last-child,
.table th:last-child {
  border-top-right-radius: var(--radius-lg);
}

/* 表格主体样式 - 精致行效果 */
.data-table td,
.table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
  transition: all var(--transition-fast);
}

.data-table tbody tr,
.table tbody tr {
  transition: all var(--transition-fast);
  background: white;
}

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.06) 0%, rgba(59, 130, 246, 0.03) 50%, rgba(59, 130, 246, 0.06) 100%);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
  transform: scale(1.002);
}

.data-table tbody tr:last-child td,
.table tbody tr:last-child td {
  border-bottom: none;
}

/* 斑马纹效果 - 更柔和的对比 */
.data-table tbody tr:nth-child(even),
.table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

.data-table tbody tr:nth-child(even):hover,
.table tbody tr:nth-child(even):hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
}

/* 表格整体边框与阴影 - 增强立体感 */
.data-table,
.table {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 表格内操作按钮组优化 */
.data-table .action-buttons,
.table .action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ========== 状态标签/徽章 - 高端美化版 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  letter-spacing: 0.035em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
  text-transform: uppercase;
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* 渐变背景徽章 */
.badge-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.25);
}

.badge-warning {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(234, 179, 8, 0.25);
}

.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25);
}

.badge-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.25);
}

.badge-gray {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(107, 114, 128, 0.25);
}

.badge-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

.badge-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.25);
}

.badge-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

/* 柔和背景徽章（浅色版本） */
.badge-soft-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  box-shadow: none;
}

.badge-soft-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #ca8a04;
  box-shadow: none;
}

.badge-soft-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  box-shadow: none;
}

.badge-soft-info {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  box-shadow: none;
}

.badge-soft-primary {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  box-shadow: none;
}

/* ========== 表单组件 - 高端美化版 ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.625rem;
  letter-spacing: 0.025em;
}

.form-label.required::after {
  content: '*';
  color: var(--danger-500);
  margin-left: 0.25rem;
  font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-800);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

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

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-50);
  border-color: var(--gray-200);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger-500);
  margin-top: 0.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-error::before {
  content: '⚠';
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
  font-style: italic;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* 表单组内联布局 */
.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.form-inline .form-group {
  margin-bottom: 0;
  flex: 1;
}

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

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

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition);
  display: none;
}

.modal-overlay.active .modal {
  transform: scale(1);
  display: block;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.modal-close {
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
  flex: 1;
}

/* 大模态框样式 */
.modal-lg {
  max-width: 800px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  flex-shrink: 0;
}

/* 模态框对话框样式 */
.modal-dialog {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ========== Toast 提示 ========== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left-color: var(--success-500);
}

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

.toast.warning {
  border-left-color: var(--warning-500);
}

.toast.info {
  border-left-color: var(--info-500);
}

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
}

/* ========== 加载状态 ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========== 空状态 ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

/* ========== 响应式 ========== */

/* 平板及以下（1024px） */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .search-box input {
    width: 200px;
  }
  
  /* 图表网格调整 */
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 手机横屏及以下（768px） */
@media (max-width: 768px) {
  /* 页面头部调整 */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .search-box {
    display: none;
  }

  .user-info {
    display: none;
  }
  
  /* 统计卡片调整为 2 列 */
  .lg\:grid-cols-4,
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* 图表网格调整为单列 */
  .lg\:grid-cols-3,
  .lg\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  /* 顶部栏调整 */
  .header {
    padding: 0 1rem;
  }
  
  .header-title {
    font-size: 1.125rem;
  }
  
  /* 页面内容间距减小 */
  .page-content {
    padding: 1rem;
  }
  
  /* 卡片间距减小 */
  .mb-6 {
    margin-bottom: 1rem;
  }
  
  .gap-6 {
    gap: 1rem;
  }
}

/* 手机竖屏（640px 及以下） */
@media (max-width: 640px) {
  /* 统计卡片调整为单列 */
  .lg\:grid-cols-4,
  .md\:grid-cols-2,
  .grid-cols-1 {
    grid-template-columns: 1fr;
  }
  
  /* 侧边栏菜单按钮 */
  .mobile-menu-btn {
    display: block !important;
  }
  
  /* 表格横向滚动 */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
  }
  
  /* 模态框全屏 */
  .modal {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
  
  /* Toast 提示调整 */
  .toast {
    min-width: auto;
    width: calc(100vw - 2rem);
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
  }
  
  /* 按钮全宽 */
  .btn {
    width: 100%;
  }
  
  .page-actions .btn {
    width: auto;
  }
  
  /* 字体大小调整 */
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .card-title {
    font-size: 0.95rem;
  }
}

/* 移动端菜单切换按钮（默认隐藏） */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: var(--gray-600);
  cursor: pointer;
}

/* 移动端遮罩层 */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

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

/* ========== 分页组件 - 高端美化版 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(.disabled) {
  border-color: var(--primary-400);
  background: var(--primary-50);
  color: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.page-btn.active {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  border-color: var(--primary-600);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-50);
}

.page-btn svg {
  width: 16px;
  height: 16px;
}

/* ========== 工具类 ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-primary { color: var(--primary-600); }
.text-success { color: var(--success-600); }
.text-danger { color: var(--danger-600); }
.text-warning { color: var(--warning-600); }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }