/* ============================================================
   清华职校管理系统 - UI增强第二阶段样式 v2.0
   包含: ECharts图表区域 / Excel导出按钮 / 学员详情时间线 / 证书提醒增强
   ============================================================ */

/* ===== 1. 数据看板图表区域 ===== */
.dash-charts-section {
  margin-bottom: 16px;
}
.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.chart-card:hover {
  box-shadow: 0 4px 20px rgba(31,36,48,0.1);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chart-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card-title .lucide {
  color: var(--primary);
}
.chart-card-actions {
  display: flex;
  gap: 6px;
}
.chart-tab-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.chart-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.chart-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chart-container {
  width: 100%;
  height: 280px;
}
.chart-container.small {
  height: 220px;
}
.chart-container.large {
  height: 340px;
}
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
  font-size: 13px;
}
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
  font-size: 13px;
  gap: 8px;
}

/* ===== 2. Excel导出按钮 ===== */
.btn-excel {
  background: linear-gradient(135deg, #1d6f42 0%, #185a36 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(29,111,66,0.25);
}
.btn-excel:hover {
  background: linear-gradient(135deg, #22804d 0%, #1d6f42 100%);
  box-shadow: 0 4px 12px rgba(29,111,66,0.35);
}
.btn-excel .lucide {
  color: #fff;
}

/* 导出进度弹窗 */
.export-progress-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.export-progress-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 16px 60px rgba(0,0,0,0.2);
}
.export-progress-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.export-progress-bar-wrap {
  height: 8px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.export-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4a8af5);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.export-progress-text {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

/* ===== 3. 学员详情时间线 ===== */
.student-timeline-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.student-timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.student-timeline {
  position: relative;
  padding-left: 24px;
}
.student-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-light), var(--border));
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  z-index: 1;
}
.timeline-dot.success {
  border-color: var(--success);
}
.timeline-dot.warning {
  border-color: var(--warning);
}
.timeline-dot.danger {
  border-color: var(--danger);
}
.timeline-dot.info {
  border-color: #4a8af5;
}
.timeline-content {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--primary);
}
.timeline-content.success {
  border-left-color: var(--success);
}
.timeline-content.warning {
  border-left-color: var(--warning);
}
.timeline-content.danger {
  border-left-color: var(--danger);
}
.timeline-content.info {
  border-left-color: #4a8af5;
}
.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.timeline-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.timeline-date {
  font-size: 11px;
  color: var(--text-3);
}
.timeline-desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.timeline-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  margin-top: 4px;
}
.timeline-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ===== 4. 证书到期提醒增强 ===== */
.cert-alert-card {
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  border: 1px solid #ffd4d4;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cert-alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cert-alert-icon.urgent {
  background: var(--danger-bg);
}
.cert-alert-icon.urgent .lucide {
  color: var(--danger);
}
.cert-alert-icon.warning {
  background: var(--warning-bg);
}
.cert-alert-icon.warning .lucide {
  color: var(--warning);
}
.cert-alert-icon.info {
  background: var(--primary-light);
}
.cert-alert-icon.info .lucide {
  color: var(--primary);
}
.cert-alert-content {
  flex: 1;
  min-width: 0;
}
.cert-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.cert-alert-desc {
  font-size: 12px;
  color: var(--text-2);
}
.cert-alert-count {
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.cert-alert-count.urgent {
  color: var(--danger);
}
.cert-alert-count.warning {
  color: var(--warning);
}
.cert-alert-count.info {
  color: var(--primary);
}

/* 提醒项级别标签 */
.reminder-level-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}
.reminder-level-tag.urgent {
  background: var(--danger-bg);
  color: var(--danger);
}
.reminder-level-tag.warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.reminder-level-tag.info {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== 5. 响应式适配 ===== */
@media (max-width: 1023px) {
  .dash-charts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .chart-container {
    height: 240px;
  }
  .chart-container.large {
    height: 280px;
  }
  .student-timeline {
    padding-left: 20px;
  }
  .cert-alert-card {
    padding: 10px 12px;
  }
  .cert-alert-icon {
    width: 36px;
    height: 36px;
  }
  .cert-alert-count {
    font-size: 18px;
  }
}
