:root {
  --primary: #7C3AED; --primary-hover: #6D28D9; --primary-light: #F5F3FF;
  --secondary: #EC4899; --bg-main: #F8FAFC; --sidebar-bg: #1E1B4B;
  --card-bg: #FFFFFF; --text-main: #0F172A; --text-muted: #64748B;
  --border: #E2E8F0; --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background: var(--bg-main); color: var(--text-main); min-height: 100vh; overflow-x: hidden; }

.app-layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; position: relative; }
.sidebar { width: 250px; background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; z-index: 100; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-header { padding: 20px 18px; border-bottom: 1px solid #312E81; }
.brand-title { font-size: 16px; font-weight: 800; color: #C4B5FD; display: flex; align-items: center; gap: 6px; }
.brand-sub { font-size: 11px; color: #A5B4FC; margin-top: 4px; line-height: 1.4; }
.btn-close-sidebar { display: none; background: rgba(255, 255, 255, 0.15); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; cursor: pointer; }
.menu-list { flex: 1; padding: 16px 10px; list-style: none; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; color: #C7D2FE; cursor: pointer; margin-bottom: 6px; transition: all 0.15s ease; }
.menu-item.active { background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.menu-item:hover:not(.active) { background: #312E81; color: #fff; }
.sidebar-footer { padding: 16px 18px; border-top: 1px solid #312E81; font-size: 11.5px; color: #94A3B8; background: #18153B; line-height: 1.6; }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 90; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top-navbar { height: 60px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.btn-hamburger { display: none; background: none; border: none; font-size: 22px; color: #1E1B4B; cursor: pointer; padding: 6px 10px 6px 0; }
.navbar-title { font-size: 15px; font-weight: 800; color: #1E1B4B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.content-body { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: #fff; border-radius: 14px; padding: 16px 18px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); transition: all 0.25s ease; }
.kpi-card.highlight { border-color: #7C3AED; box-shadow: 0 0 0 2px #C4B5FD; }
.kpi-title { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kpi-val { font-size: 26px; font-weight: 800; color: #1E1B4B; margin: 6px 0 2px 0; line-height: 1.2; }
.kpi-sub { font-size: 11.5px; color: #7C3AED; font-weight: 600; }

.card { background: #fff; border-radius: 14px; padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-title { font-size: 15px; font-weight: 800; color: #0F172A; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: #F8FAFC; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; white-space: nowrap; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; min-width: 680px; }
th { background: #F8FAFC; padding: 12px 14px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
tr:hover td { background: #FAF5FF; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-teacher { background: #FEE2E2; color: #DC2626; }
.badge-primary-low { background: #FEF3C7; color: #D97706; }
.badge-primary-high { background: #E0E7FF; color: #4338CA; }
.badge-junior { background: #DBEAFE; color: #2563EB; }
.badge-high { background: #FCE7F3; color: #BE185D; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; border: none; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #EC4899; color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #F1F5F9; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.progress-bar-bg { width: 100%; height: 8px; background: #E2E8F0; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #7C3AED, #EC4899); border-radius: 4px; transition: width 0.5s ease; }

.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.course-card { background: #FDF4FF; border: 1px solid #F0ABFC; border-radius: 12px; padding: 16px; }
.course-title { font-size: 14.5px; font-weight: 800; color: #86198F; margin-bottom: 6px; }
.course-desc { font-size: 12px; color: #701A75; line-height: 1.5; margin-bottom: 12px; }
.stats-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(8px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.simulator-modal { width: 390px; max-width: 95vw; height: 680px; max-height: 92vh; background: #F8FAFC; border-radius: 36px; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 6px #1E1B4B; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sim-island { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 90px; height: 18px; background: #000; border-radius: 10px; z-index: 10; }
.sim-header { background: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%); color: #fff; padding: 32px 16px 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.sim-title { font-size: 14px; font-weight: 800; }
.btn-close-sim { background: rgba(255, 255, 255, 0.25); border: none; color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sim-body { flex: 1; overflow-y: auto; padding: 16px; }
.sim-card { background: #fff; border-radius: 14px; padding: 16px; border: 1px solid var(--border); margin-bottom: 12px; }
.sim-card-title { font-size: 13.5px; font-weight: 800; color: #1E1B4B; margin-bottom: 8px; }

.toast-msg { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #1E1B4B; color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 13px; font-weight: 700; z-index: 10000; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25); border: 1px solid #A855F7; max-width: 90vw; text-align: center; }

/* 响应式媒体查询 (Desktop ➔ Tablet ➔ Mobile) */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; height: 100vh; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; transform: translateX(-100%); box-shadow: 10px 0 30px rgba(0, 0, 0, 0.35); }
  .sidebar.open { transform: translateX(0); }
  .btn-close-sidebar, .btn-hamburger { display: inline-flex; }
  .top-navbar { height: 54px; padding: 0 14px; }
  .navbar-title { font-size: 13.5px; }
  .content-body { padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .kpi-card { padding: 12px 14px; border-radius: 12px; }
  .kpi-val { font-size: 22px; }
  .kpi-title { font-size: 11px; }
  .kpi-sub { font-size: 10.5px; }
  .card { padding: 14px; border-radius: 12px; margin-bottom: 14px; }
  .course-grid, .stats-overview-grid { grid-template-columns: 1fr; gap: 12px; }
  .simulator-modal { width: 95vw; height: 85vh; border-radius: 24px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; gap: 8px; }
  .navbar-actions .btn-text { display: none; }
  .navbar-actions .btn { padding: 6px 10px; }
  .filter-tabs { gap: 6px; }
  .filter-btn { padding: 5px 10px; font-size: 11px; }
}
