/* ============================================
   儿童赛事追踪 - 管理后台统一样式
   ============================================ */

/* --- CSS变量 --- */
:root {
  --primary: #4A90D9;
  --primary-dark: #357ABD;
  --primary-light: #6BA3E0;
  --danger: #E74C3C;
  --danger-dark: #C0392B;
  --success: #27AE60;
  --warning: #F39C12;
  --info: #3498DB;
  --sidebar-bg: #2C3E50;
  --sidebar-hover: #34495E;
  --sidebar-active: #1ABC9C;
  --content-bg: #F5F7FA;
  --card-bg: #FFFFFF;
  --text-primary: #2C3E50;
  --text-secondary: #7F8C8D;
  --text-light: #BDC3C7;
  --border-color: #E1E8ED;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar-width: 220px;
  --header-height: 60px;
  --transition: all 0.3s ease;
}

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

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

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

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

/* --- 登录页 --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4A90D9 0%, #2C3E50 50%, #1ABC9C 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: loginBgMove 20s linear infinite;
}

@keyframes loginBgMove {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 48px 40px;
  width: 400px;
  max-width: 90vw;
  position: relative;
  z-index: 1;
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-card .login-logo h1 {
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.login-card .login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-card .form-group {
  margin-bottom: 20px;
}

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

.login-card .form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.login-card .form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.login-card .login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.login-card .login-btn:hover {
  background: var(--primary-dark);
}

.login-card .login-btn:active {
  transform: scale(0.98);
}

.login-card .login-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: none;
  text-align: center;
}

/* --- 侧边栏 --- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

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

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
}

.sidebar-nav .nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-item.active {
  background: rgba(26, 188, 156, 0.15);
  color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
  font-weight: 500;
}

.sidebar-nav .nav-item .nav-icon {
  width: 20px;
  margin-right: 12px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-item {
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-footer .nav-item:hover {
  color: var(--danger);
}

/* --- 主内容区 --- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px;
}

/* --- 页面头部 --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-header .breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- 统计卡片 --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.stat-card .stat-icon.blue {
  background: rgba(74, 144, 217, 0.1);
  color: var(--primary);
}

.stat-card .stat-icon.green {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success);
}

.stat-card .stat-icon.orange {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning);
}

.stat-card .stat-icon.red {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- 卡片容器 --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

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

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- 图表区域 --- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* CSS柱状图 */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-chart .bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-chart .bar-item .bar-label {
  width: 80px;
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart .bar-item .bar-track {
  flex: 1;
  height: 24px;
  background: var(--content-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-chart .bar-item .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  min-width: 2px;
}

.bar-chart .bar-item .bar-value {
  width: 40px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* 横向条形图（标签TOP10） */
.h-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h-bar-chart .h-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.h-bar-chart .h-bar-item .h-bar-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.h-bar-chart .h-bar-item .h-bar-rank.top3 {
  background: var(--warning);
}

.h-bar-chart .h-bar-item .h-bar-label {
  width: 80px;
  font-size: 13px;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h-bar-chart .h-bar-item .h-bar-track {
  flex: 1;
  height: 20px;
  background: var(--content-bg);
  border-radius: 4px;
  overflow: hidden;
}

.h-bar-chart .h-bar-item .h-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.8s ease;
}

.h-bar-chart .h-bar-item .h-bar-value {
  width: 36px;
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* --- 表格 --- */
.table-container {
  overflow-x: auto;
}

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

table thead th {
  background: var(--content-bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

table thead th:hover {
  color: var(--primary);
}

table thead th .sort-icon {
  margin-left: 4px;
  font-size: 12px;
  opacity: 0.4;
}

table thead th.sorted .sort-icon {
  opacity: 1;
  color: var(--primary);
}

table tbody tr {
  transition: var(--transition);
}

table tbody tr:nth-child(even) {
  background: #FAFBFC;
}

table tbody tr:hover {
  background: rgba(74, 144, 217, 0.05);
}

table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-primary);
}

table tbody td .cell-ellipsis {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 状态标签 --- */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success);
}

.status-badge.inactive {
  background: rgba(127, 140, 141, 0.1);
  color: var(--text-secondary);
}

.status-badge.pending {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning);
}

.status-badge.error {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  gap: 6px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.btn-success:hover {
  background: #219A52;
}

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

.btn-danger:hover {
  background: var(--danger-dark);
}

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

.btn-warning:hover {
  background: #E08E0B;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- 表单 --- */
.form-group {
  margin-bottom: 16px;
}

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

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

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-control::placeholder {
  color: var(--text-light);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237F8C8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- 工具栏 --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.toolbar .search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.toolbar .search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.toolbar .search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.toolbar select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237F8C8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background: #fff;
  cursor: pointer;
}

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

/* --- 分页 --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination .page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition);
}

.pagination .page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 8px;
}

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

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 640px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
}

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

.modal.modal-lg {
  width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

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

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--content-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* --- Toast提示 --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

.toast.info {
  background: var(--info);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

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

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

/* --- 确认对话框 --- */
.confirm-dialog .modal {
  width: 420px;
}

.confirm-dialog .confirm-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
}

.confirm-dialog .confirm-message {
  text-align: center;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-dialog .confirm-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- 加载动画 --- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

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

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

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 局部加载 */
.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
  gap: 12px;
}

.loading-inline .loading-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state .empty-text {
  font-size: 15px;
  margin-bottom: 16px;
}

/* --- 快捷操作 --- */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--text-primary);
}

.quick-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.quick-action-btn .action-icon {
  font-size: 18px;
}

/* --- 推送表单 --- */
.push-form {
  max-width: 600px;
}

.push-form .radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.push-form .radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: normal;
}

.push-form .radio-group input[type="radio"] {
  accent-color: var(--primary);
}

/* --- 标签 --- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(74, 144, 217, 0.1);
  color: var(--primary);
  border-radius: 3px;
  font-size: 12px;
  margin: 2px;
}

/* --- 用户详情面板 --- */
.user-detail-panel {
  padding: 16px;
}

.user-detail-panel .detail-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.user-detail-panel .detail-label {
  width: 100px;
  color: var(--text-secondary);
  font-size: 13px;
  flex-shrink: 0;
}

.user-detail-panel .detail-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

/* --- 响应式 --- */
@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
  }
  .sidebar .nav-text,
  .sidebar-header p,
  .sidebar-footer .nav-text {
    display: none;
  }
  .sidebar-header h2 {
    font-size: 14px;
  }
  .sidebar-nav .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .sidebar-nav .nav-item .nav-icon {
    margin-right: 0;
  }
  .main-content {
    margin-left: 60px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 滚动条美化 --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- 辅助类 --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }

/* --- SVG图标 --- */
.svg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor;
  overflow: hidden;
}

.svg-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* 图标尺寸 */
.svg-icon.sm { font-size: 14px; }
.svg-icon.md { font-size: 18px; }
.svg-icon.lg { font-size: 24px; }
.svg-icon.xl { font-size: 32px; }

/* 图标颜色 */
.svg-icon.primary { color: var(--primary); }
.svg-icon.danger { color: var(--danger); }
.svg-icon.success { color: var(--success); }
.svg-icon.warning { color: var(--warning); }
.svg-icon.muted { color: var(--text-secondary); }
.svg-icon.white { color: #fff; }
