/* ========== 学情分析（教师数据看板） ========== */
.ha-page {
  min-height: calc(100vh - 56px);
  padding: 12px 16px 24px;
  background: linear-gradient(180deg, #f8f6ff 0%, #f3f7ff 40%, #f5f7fa 100%);
  box-sizing: border-box;
}

.ha-page.hidden {
  display: none;
}

#hmListView.hidden {
  display: none;
}

.ha-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ha-head-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ha-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #e63323;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ha-back-btn:hover {
  color: #c0271b;
}

.ha-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ha-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
}

.ha-title-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fef3f2;
  color: #e63323;
  font-size: 12px;
  font-weight: 600;
}

.ha-global-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ha-date-range {
  color: #4e5969;
}

.ha-query-btn {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
}

.ha-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ha-kpi-card {
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ha-kpi-label {
  font-size: 13px;
  color: #86909c;
  margin-bottom: 8px;
}

.ha-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1d2129;
  line-height: 1.2;
}

.ha-kpi-unit {
  font-size: 16px;
  font-weight: 600;
  margin-left: 2px;
}

.ha-kpi-trend {
  margin-top: 8px;
  font-size: 12px;
}

.ha-kpi-trend-up {
  color: #c0271b;
}

.ha-kpi-trend-down {
  color: #f53f3f;
}

.ha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ha-panel {
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-height: 220px;
}

.ha-panel-wide {
  grid-column: 1 / -1;
}

.ha-panel-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #1d2129;
}

.ha-chart-bars {
  min-height: 180px;
  padding: 8px 4px 0;
}

.ha-chart-bars-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  min-height: 160px;
}

.ha-bar-group {
  flex: 1;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ha-bar-stack {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.ha-bar {
  width: 18px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.35s ease;
}

.ha-bar-math {
  background: linear-gradient(180deg, #e63323, #f2796b);
}

.ha-bar-chinese {
  background: linear-gradient(180deg, #c0271b, #f8a99e);
}

.ha-bar-english {
  background: linear-gradient(180deg, #f2796b, #f2796b);
}

.ha-bar-label {
  font-size: 12px;
  color: #4e5969;
  text-align: center;
}

.ha-bar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: #86909c;
}

.ha-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ha-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.ha-chart-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ha-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.ha-chart-row-name {
  width: 64px;
  flex-shrink: 0;
  color: #4e5969;
}

.ha-chart-row-track {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: #f2f3f5;
  overflow: hidden;
}

.ha-chart-row-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #e63323, #f2796b);
}

.ha-chart-row-fill--cyan {
  background: linear-gradient(90deg, #f2796b, #f2796b);
}

.ha-chart-row-value {
  width: 44px;
  text-align: right;
  font-weight: 600;
  color: #1d2129;
}

.ha-weak-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ha-weak-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.ha-weak-name {
  flex: 1;
  color: #1d2129;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ha-weak-tag {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 4px;
  background: #fef3f2;
  color: #c0271b;
  font-size: 12px;
}

.ha-weak-track {
  width: 120px;
  height: 8px;
  border-radius: 4px;
  background: #f2f3f5;
  overflow: hidden;
  flex-shrink: 0;
}

.ha-weak-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c0271b, #ffb65d);
}

.ha-weak-rate {
  width: 40px;
  text-align: right;
  font-weight: 600;
  color: #f53f3f;
  flex-shrink: 0;
}

.ha-table-wrap {
  overflow-x: auto;
}

.ha-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ha-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  color: #86909c;
  background: #fafafa;
  border-bottom: 1px solid #f2f3f5;
  white-space: nowrap;
}

.ha-table td {
  padding: 12px;
  border-bottom: 1px solid #f2f3f5;
  color: #1d2129;
  vertical-align: middle;
}

.ha-table tbody tr:hover {
  background: #fafafa;
}

.ha-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f2f3f5;
  color: #4e5969;
  font-size: 12px;
  font-weight: 600;
}

.ha-rank-top {
  background: #fef3f2;
  color: #c0271b;
}

.ha-wrong-title {
  font-weight: 500;
  line-height: 1.4;
}

.ha-wrong-kp {
  margin-top: 2px;
  font-size: 12px;
  color: #86909c;
}

@media (max-width: 1100px) {
  .ha-kpis {
    grid-template-columns: 1fr;
  }

  .ha-grid {
    grid-template-columns: 1fr;
  }

  .ha-panel-wide {
    grid-column: auto;
  }

  .ha-weak-track {
    width: 80px;
  }
}
