/* ============================================================
   AI 学院 · 增强层（在 academy.css 之后加载）
   新增：打卡热力图 / 学习里程碑 / 继续上次阅读 / 卡片倾斜 / 滚动显现
   全部读取课程站写在浏览器里的真实数据，不做任何小游戏。
   ============================================================ */

/* ---------- 附加主视觉按钮 ---------- */
.ac-hero-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.ac-hero-tip { font-size: 12.5px; color: var(--ac-dim); }
#acContinue { animation: acPulse 2.6s ease-in-out infinite; }
@keyframes acPulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(255, 126, 182, .28); }
  50% { box-shadow: 0 8px 26px rgba(255, 126, 182, .55); }
}

/* ---------- 两栏面板 ---------- */
.ac-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 4px 0 18px;
}
.ac-panel {
  padding: 20px;
  border-radius: 16px;
  background: var(--ac-card, #fff);
  border: 1px solid var(--ac-line);
  box-shadow: 0 4px 18px rgba(70, 55, 90, .06);
}
.ac-panel h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: 1px; border: none; padding: 0; }
.ac-panel-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--ac-dim); }

/* ---------- 打卡热力图 ---------- */
.ac-heat {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.ac-heat i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(120, 100, 140, .12);
  transition: transform .15s ease;
}
.ac-heat i:hover { transform: scale(1.35); }
.ac-heat i.l1 { background: color-mix(in srgb, var(--ac-c1) 34%, transparent); }
.ac-heat i.l2 { background: color-mix(in srgb, var(--ac-c1) 58%, transparent); }
.ac-heat i.l3 { background: color-mix(in srgb, var(--ac-c1) 80%, transparent); }
.ac-heat i.l4 { background: linear-gradient(135deg, var(--ac-c1), var(--ac-c2)); }
.ac-heat-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ac-dim);
}
.ac-heat-legend i { width: 11px; height: 11px; border-radius: 3px; background: rgba(120, 100, 140, .12); }
.ac-heat-legend i.l1 { background: color-mix(in srgb, var(--ac-c1) 34%, transparent); }
.ac-heat-legend i.l2 { background: color-mix(in srgb, var(--ac-c1) 58%, transparent); }
.ac-heat-legend i.l3 { background: color-mix(in srgb, var(--ac-c1) 80%, transparent); }
.ac-heat-legend i.l4 { background: linear-gradient(135deg, var(--ac-c1), var(--ac-c2)); }

/* ---------- 里程碑徽章 ---------- */
.ac-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ac-badge {
  padding: 12px 8px;
  text-align: center;
  border-radius: 12px;
  background: rgba(120, 100, 140, .06);
  border: 1px solid var(--ac-line);
  transition: transform .22s cubic-bezier(.22, .61, .36, 1), box-shadow .22s ease;
}
.ac-badge b { display: block; font-size: 22px; margin-bottom: 5px; filter: grayscale(1); opacity: .45; }
.ac-badge span { font-size: 11.5px; color: var(--ac-dim); line-height: 1.5; display: block; }
.ac-badge.on {
  background: linear-gradient(150deg, rgba(255, 126, 182, .16), rgba(157, 123, 255, .16));
  border-color: rgba(255, 126, 182, .45);
}
.ac-badge.on b { filter: none; opacity: 1; }
.ac-badge.on span { color: var(--ac-ink); }
.ac-badge.on:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(255, 126, 182, .22); }

/* ---------- 卡片倾斜（只在精确指针设备上启用） ---------- */
@media (hover: hover) and (pointer: fine) {
  .ac-mod { will-change: transform; }
}

/* ---------- 滚动显现 ---------- */
.ac-reveal { opacity: 0; transform: translateY(18px); }
.ac-reveal.in { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.22, .61, .36, 1), transform .6s cubic-bezier(.22, .61, .36, 1); }

/* ---------- 深色主题适配 ---------- */
.dark .ac-panel, body.dark-theme .ac-panel, .night .ac-panel {
  background: #23202e;
  border-color: rgba(255, 255, 255, .1);
}
.dark .ac-badge, body.dark-theme .ac-badge { background: rgba(255, 255, 255, .05); }

/* ---------- 手机端 ---------- */
@media (max-width: 640px) {
  .ac-badges { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
  .ac-heat { grid-template-rows: repeat(7, 10px); }
  .ac-heat i { width: 10px; height: 10px; }
}

/* ---------- 打印/无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ac-reveal { opacity: 1; transform: none; }
  #acContinue { animation: none; }
}
