/* ===== 百优体育管理系统 - 全局样式 (Logo VI 色) ===== */
:root {
  /* 主色系 - Logo 深蓝 #003090 */
  --blue-700: #002080;
  --blue-600: #003090;
  --blue-500: #1A40A0;
  --blue-400: #4070C8;
  --blue-100: #D0E0F0;
  --blue-50:  #EFF4FC;

  /* 侧边栏 - Logo 深蓝 */
  --sidebar-bg: #003090;
  --sidebar-bg-dark: #002080;
  --sidebar-bg-hover: rgba(255,255,255,0.12);
  --sidebar-text: rgba(255,255,255,0.85);
  --sidebar-text-active: #ffffff;
  --sidebar-section-label: rgba(255,255,255,0.55);

  /* 重点色 - Logo 橙 #F06000 */
  --orange-600: #E05500;
  --orange-500: #F06000;
  --orange-400: #FF7520;
  --orange-100: #FFE0D0;
  --orange-50:  #FFF5F0;

  /* 收支色 */
  --emerald-600: #059669;
  --emerald-500: #10B981;
  --emerald-50:  #ECFDF5;
  --rose-600: #E11D48;
  --rose-500: #F43F5E;
  --rose-50:  #FFF1F2;

  /* 中性色 */
  --bg: #F5F7FA;
  --white: #FFFFFF;
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* 别名 */
  --primary: var(--blue-600);
  --primary-light: var(--blue-50);
  --primary-dark: var(--blue-700);
  --accent: var(--orange-500);
  --success: var(--emerald-600);
  --success-light: var(--emerald-50);
  --danger: var(--rose-600);
  --danger-light: var(--rose-50);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --sidebar-w: 200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-badge { flex-shrink: 0; }
.logo-circle-sm { flex-shrink: 0; display: flex; align-items: center; }
.logo-circle { display: flex; align-items: center; justify-content: center; }

/* ===== 官方横向 Logo 图片 ===== */
.logo-img {
  display: block;
  height: 80px;       /* 登录页 / 门户页主 Logo */
  width: auto;
  max-width: 100%;
  margin: 0 auto;     /* 居中 */
}
.logo-img-sm {
  height: 36px;       /* 侧边栏 mini Logo：白底直接放在深色侧边栏上 */
}

/* ===== 顶栏 / 侧边栏 LOGO 尺寸（4.5:1 横向） ===== */
.brand-logo {
  display: block;
}
.brand-logo-topbar {
  height: 36px;        /* 顶栏高度，留点呼吸 */
  width: auto;
  max-height: 36px;
  object-fit: contain;
}
.brand-logo-sidebar {
  width: 100%;         /* 填满侧边栏（去掉左右 padding 后约 164px） */
  max-width: 168px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

/* 登录页Logo下方的系统标签 */
.login-logo .brand-system-tag {
  margin-top: 14px;
  padding: 6px 16px;
  background: rgba(0, 48, 144, 0.10);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
}
.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-text .name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.2;
}
.logo-text .sub {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.nav { flex: 1; padding: 14px 8px; overflow-y: auto; }
.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-section-label);
  padding: 8px 12px 6px;
  margin-top: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .15s ease;
  user-select: none;
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--sidebar-bg-dark);
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 3px;
  background: var(--orange-500);
  border-radius: 0 3px 3px 0;
}
.nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ===== 顶部栏 ===== */
.topbar {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.2px;
}
.topbar .actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 20px 24px; }

/* ===== 公告/提示条 ===== */
.announcement {
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,48,144,0.15);
}
.announcement .version-tag {
  background: var(--orange-500);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.announcement strong { color: #fff; }
.announcement .ann-text { color: rgba(255,255,255,0.95); }

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}
.card-title i { color: var(--blue-600); margin-right: 6px; }

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 18px 20px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; font-weight: 500; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--blue-600); letter-spacing: -0.5px; }
.stat-card .value.green { color: var(--emerald-600); }
.stat-card .value.red { color: var(--rose-600); }
.stat-card .value.orange { color: var(--orange-500); }
.stat-card .value.gray { color: var(--gray-700); }
.stat-card .meta { font-size: 12px; color: var(--gray-400); margin-top: 6px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 11px 14px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
  font-size: 12px;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }
tfoot td {
  padding: 12px 14px;
  border-top: 2px solid var(--gray-200);
  font-weight: 700;
}

/* ===== 标签/徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-income { background: var(--emerald-50); color: var(--emerald-600); }
.badge-expense { background: var(--rose-50); color: var(--rose-600); }
.badge-badminton { background: var(--blue-50); color: var(--blue-600); }
.badge-tabletennis { background: var(--orange-50); color: var(--orange-600); }
.badge-basketball { background: #FEF3C7; color: #B45309; }
/* 学科徽章（会员系统） */
.badge-sub-yw { background: var(--blue-50); color: var(--blue-600); }
.badge-sub-sx { background: var(--orange-50); color: var(--orange-600); }
.badge-sub-yy { background: #FEF3C7; color: #B45309; }
.badge-sub-wl { background: var(--emerald-50); color: var(--emerald-600); }
.badge-sub-hx { background: var(--rose-50); color: var(--rose-600); }
.badge-other { background: var(--gray-100); color: var(--gray-600); }
.badge-in { background: var(--emerald-50); color: var(--emerald-600); }
.badge-out { background: var(--rose-50); color: var(--rose-600); }
.badge-warning { background: var(--orange-50); color: var(--orange-600); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue-600);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-700); }
.btn-success { background: var(--emerald-600); color: #fff; }
.btn-success:hover { background: var(--emerald-500); }
.btn-danger { background: var(--rose-600); color: #fff; }
.btn-danger:hover { background: var(--rose-500); }
.btn-accent {
  background: var(--orange-500); color: #fff;
}
.btn-accent:hover { background: var(--orange-600); }
.btn-outline {
  background: #fff;
  color: var(--blue-600);
  border: 1px solid var(--blue-600);
}
.btn-outline:hover { background: var(--blue-50); }
.btn-outline-gray {
  background: #fff;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.btn-outline-gray:hover { background: var(--gray-50); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
}
.btn-icon:hover { opacity: 0.8; }
.btn-edit { background: var(--blue-50); color: var(--blue-600); }
.btn-delete { background: var(--rose-50); color: var(--rose-600); }
.btn-stock-in { background: var(--emerald-50); color: var(--emerald-600); }
.btn-stock-out { background: var(--orange-50); color: var(--orange-600); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all .2s;
  background: #fff;
  color: var(--gray-700);
}
.form-control:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filter-bar select, .filter-bar input {
  padding: 7px 11px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
  background: #fff;
  color: var(--gray-600);
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--blue-500); }

/* ===== 模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,41,55,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 540px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.modal-header h3 i { color: var(--blue-600); margin-right: 6px; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty .icon { font-size: 36px; margin-bottom: 12px; color: var(--gray-300); }
.empty .text { font-size: 14px; }

/* ===== 图表容器 ===== */
.chart-container {
  position: relative;
  height: 300px;
}

/* ===== 工具类 ===== */
.text-green { color: var(--emerald-600); }
.text-red { color: var(--rose-600); }
.text-gray { color: var(--gray-400); }
.text-blue { color: var(--blue-600); }
.text-orange { color: var(--orange-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-lg { font-size: 16px; }
.hidden { display: none !important; }

/* ===== 移动端汉堡按钮 & 抽屉 ===== */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  /* 侧边栏 → 抽屉 */
  .menu-toggle { display: inline-flex; }
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0,0,0,0.35);
  }
  .main { margin-left: 0; }

  /* 顶栏 */
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .topbar .user-info { display: none; }
  .topbar .user-menu .fa-chevron-down { display: none; }
  .topbar .actions { gap: 6px; }
  .topbar .actions .btn { padding: 6px 10px; font-size: 12px; }
  .topbar .actions .btn i + span { display: none; }
  .topbar .menu-toggle { width: 36px; height: 36px; }

  /* 内容区 */
  .content { padding: 14px; }
  .card { padding: 14px; border-radius: 8px; }
  .card-header { flex-wrap: wrap; gap: 8px; }

  /* 统计卡片 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .value { font-size: 20px; }
  .stat-card .label { font-size: 12px; }

  /* 表单/网格 */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr !important; }
  .checkin-grid { grid-template-columns: 1fr !important; }
  .chart-container { height: 240px; }

  /* 输入控件：16px 防止 iOS 聚焦自动放大 */
  .form-control,
  .filter-bar select,
  .filter-bar input,
  .login-form .form-control { font-size: 16px; }

  /* 筛选栏占满整行 */
  .filter-bar select, .filter-bar input { flex: 1 1 45%; min-width: 0; }
  .filter-bar .btn { flex: 1 1 100%; justify-content: center; }

  /* 表格：小字号 + 横向滑动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12px; }
  thead th, tbody td, tfoot td { padding: 9px 10px; }

  /* 触控目标加大 */
  .btn { padding: 9px 14px; }
  .btn-icon { width: 34px; height: 34px; font-size: 13px; }

  /* 弹窗占满屏幕 */
  .modal-overlay { padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); align-items: stretch; }
  .modal { width: 100%; max-width: 100%; max-height: calc(100vh - 24px); }

  /* 公告条 */
  .announcement { font-size: 12px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }

  /* 登录页 */
  .login-box { width: 100%; padding: 28px 20px 24px; }
  .logo-img { height: 56px; }

  /* 门户页 */
  .portal-page { padding: 16px; }
  .portal-header { margin-bottom: 18px; }
  .portal-header .portal-logo .logo-img { height: 52px; }
  .portal-header h1 { font-size: 20px; }
  .portal-header .sub { font-size: 11px; letter-spacing: 2px; }
  .portal-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .portal-card { padding: 14px 10px 12px; }
  .portal-card .portal-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; margin-bottom: 8px; }
  .portal-card h2 { font-size: 14px; }
  .portal-card p { font-size: 11px; margin-bottom: 8px; min-height: 35px; }
  .portal-card .portal-btn { padding: 4px 10px; font-size: 11px; }
}
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar .actions .btn span { display: none; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card p { min-height: 19px; }
}

/* ===== 登录页 ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 50%, var(--blue-500) 100%);
}
.login-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(240,96,0,0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 45%);
}
.login-box {
  position: relative;
  width: 400px;
  max-width: 90vw;
  background: #fff;
  border-radius: 14px;
  padding: 40px 32px 32px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.login-logo .brand {
  margin-top: 14px;
}
.login-logo .brand-main {
  display: inline-block;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #003090 0%, #F06000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo .brand-slogan {
  font-size: 12px;
  color: #F06000;
  letter-spacing: 3px;
  margin-top: 4px;
  font-weight: 500;
}
.login-logo .brand-system {
  margin-top: 14px;
  padding: 6px 16px;
  background: rgba(0, 48, 144, 0.10);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 1px;
}
.login-form .form-group { margin-bottom: 16px; }
.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap i.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  pointer-events: none;
}
.login-form .form-control {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all .2s;
  background: var(--gray-50);
  color: var(--gray-800);
}
.login-form .form-control::placeholder { color: var(--gray-400); }
.login-form .form-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
  background: #fff;
}
.login-form .btn-login {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
  background: var(--blue-600);
  color: #fff;
  letter-spacing: 1px;
  margin-top: 6px;
}
.login-form .btn-login:hover { background: var(--blue-700); }
.login-form .btn-login:active { transform: translateY(0); }
.login-error {
  background: var(--rose-50);
  border: 1px solid #FECDD3;
  color: var(--rose-600);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.login-error.show { display: flex; }
.login-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.8;
}
.login-hint code {
  background: var(--blue-50);
  color: var(--blue-600);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin: 0 2px;
}

/* 用户菜单 */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.user-menu:hover { background: var(--gray-100); }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.user-info .user-role { font-size: 11px; color: var(--gray-500); }
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 170px;
  display: none;
  z-index: 100;
  overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  transition: background .15s;
}
.user-dropdown-item:hover { background: var(--gray-50); }
.user-dropdown-item i { width: 14px; text-align: center; color: var(--gray-400); }
.user-dropdown-item.danger { color: var(--rose-600); }
.user-dropdown-item.danger i { color: var(--rose-600); }

/* 登录抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ========== 门户页 ========== */
.portal-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.portal-page::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(240,96,0,0.25) 0%, transparent 70%);
  border-radius: 50%;
}
.portal-page::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.portal-container {
  position: relative;
  max-width: 1080px;
  width: 100%;
  z-index: 1;
}
.portal-header {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
}
.portal-header .portal-logo { margin-bottom: 10px; }
.portal-header .portal-logo .logo-img { height: 64px; }
.portal-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.portal-header .sub {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.portal-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px 18px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  text-decoration: none;
  color: inherit;
  display: block;
}
.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}
.portal-card .portal-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.portal-card.finance .portal-icon { background: var(--blue-50); color: var(--blue-600); }
.portal-card.inventory .portal-icon { background: var(--orange-50); color: var(--orange-500); }
.portal-card.membership .portal-icon { background: #ECFDF5; color: #059669; }
.portal-card.attendance .portal-icon { background: #ECFEFF; color: #0891B2; }
.portal-card.hr .portal-icon { background: #F5F3FF; color: #7C3AED; }
.portal-card.coach .portal-icon { background: #FFF7ED; color: #EA580C; }
.portal-card.principal .portal-icon { background: #FEF2F2; color: #E11D48; }
.portal-card.growth .portal-icon { background: #F0FDF4; color: #16A34A; }
.portal-card.recruit .portal-icon { background: #EFF6FF; color: #2563EB; }
.portal-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 5px;
  white-space: nowrap;
}
.portal-card p {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 12px;
  min-height: 19px;
}
.portal-card .portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
.portal-card.finance .portal-btn { background: var(--blue-600); color: #fff; }
.portal-card.inventory .portal-btn { background: var(--orange-500); color: #fff; }
.portal-card.membership .portal-btn { background: #059669; color: #fff; }
.portal-card.attendance .portal-btn { background: #0891B2; color: #fff; }
.portal-card.hr .portal-btn { background: #7C3AED; color: #fff; }
.portal-card.coach .portal-btn { background: #EA580C; color: #fff; }
.portal-card.principal .portal-btn { background: #E11D48; color: #fff; }
.portal-card.growth .portal-btn { background: #16A34A; color: #fff; }
.portal-card.recruit .portal-btn { background: #2563EB; color: #fff; }

/* ===== 考勤打卡摄像头 ===== */
.camera-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0F172A;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-box video,
.camera-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
}
.camera-placeholder i { font-size: 34px; }
.portal-footer {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  margin-top: 18px;
}
/* ===== AI四大系统扩展样式 ===== */
/* 健康度等级 */
.hl-excellent { color: #059669; }
.hl-healthy { color: #003090; }
.hl-watch { color: #D97706; }
.hl-risk { color: #EA580C; }
.hl-danger { color: #E11D48; }
.hl-pill { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; font-size:13px; font-weight:600; }

/* 任务优先级 */
.pri-P0, .p0 { color:#E11D48; }
.pri-P1, .p1 { color:#EA580C; }
.pri-P2, .p2 { color:#64748B; }
.pri-pill { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; color:#fff; }
.pri-pill.p0 { background:#E11D48; }
.pri-pill.p1 { background:#EA580C; }
.pri-pill.p2 { background:#94a3b8; }

/* 任务/线索状态色 */
.st-open { background:rgba(240,96,0,.12); color:#EA580C; }
.st-doing { background:rgba(0,48,144,.1); color:#003090; }
.st-done { background:rgba(5,150,105,.12); color:#059669; }
.st-gray { background:rgba(100,116,139,.12); color:#64748B; }
.st-ai { background:rgba(124,58,237,.1); color:#7C3AED; }

/* AI提示块 */
.ai-block { padding:14px 16px; background:rgba(0,48,144,.05); border-left:3px solid #003090; border-radius:6px; line-height:1.8; font-size:13px; }
.ai-block b { color:#003090; }
.ai-warn { background:rgba(225,29,72,.05); border-left-color:#E11D48; }
.ai-warn b { color:#E11D48; }

/* 漏斗 */
.funnel-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.funnel-label { width:90px; font-size:13px; color:var(--gray-600); text-align:right; flex-shrink:0; }
.funnel-row .funnel-bar { height:26px; border-radius:4px; background:linear-gradient(90deg,#003090,#2E5BFF); color:#fff; font-size:12px; display:flex; align-items:center; padding:0 8px; min-width:32px; justify-content:flex-end; flex-shrink:1; max-width:100%; }
.funnel-count { font-size:13px; font-weight:600; color:var(--gray-700); white-space:nowrap; }

/* 成长路径时间线 */
.path-line { position:relative; padding-left:24px; }
.path-line::before { content:''; position:absolute; left:7px; top:6px; bottom:6px; width:2px; background:var(--gray-200); }
.path-node { position:relative; padding:10px 0 10px 12px; }
.path-node::before { content:''; position:absolute; left:-23px; top:16px; width:12px; height:12px; border-radius:50%; background:#CBD5E1; border:2px solid #fff; box-shadow:0 0 0 1px #CBD5E1; }
.path-node.current::before { background:#F06000; box-shadow:0 0 0 1px #F06000; }
.path-node.done::before { background:#059669; box-shadow:0 0 0 1px #059669; }

/* 等级徽章 */
.grade-S { background:rgba(225,29,72,.12); color:#E11D48; }
.grade-A { background:rgba(240,96,0,.12); color:#EA580C; }
.grade-B { background:rgba(0,48,144,.1); color:#003090; }
.grade-C { background:rgba(100,116,139,.12); color:#64748B; }

/* 健康度仪表条 */
.health-bar { height:10px; border-radius:999px; background:linear-gradient(90deg,#E11D48 0%,#EA580C 25%,#D97706 45%,#003090 70%,#059669 100%); position:relative; margin:18px 0 6px; }
.health-marker { position:absolute; top:-5px; width:20px; height:20px; border-radius:50%; background:#fff; border:4px solid #003090; transform:translateX(-50%); box-shadow:0 2px 6px rgba(0,0,0,.2); }
