/* ============================================================================
 * 冲击波英语成长中心 · 学院页课程列表样式（academy-courses.css）
 * ============================================================================
 * 配套 academy-courses.js。只作用于 [data-academy-courses] 内部，
 * 不碰任何共享类（.academy-grid / .academy-card 一律不覆盖）——
 * 所以本文件加进任何学院页都不会影响别处，也不会和 portal.js 的书架打架。
 *
 * 三态配色（与站点既有语义一致）
 *   免费体验课 → 金边浅底（--gold）
 *   已开通     → 墨绿实心（--ink）
 *   未开通     → 灰线描边，不可点
 * ==========================================================================*/

.ac-course-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

/* ---- 单门课程卡 ---- */
.ac-course {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line, rgba(20, 33, 28, 0.12));
  border-radius: 26px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 240, 0.9));
  padding: 22px 22px 18px;
  box-shadow: 0 10px 30px rgba(20, 33, 28, 0.06);
  transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.ac-course:hover {
  border-color: rgba(217, 107, 66, 0.42);
  box-shadow: 0 18px 44px rgba(20, 33, 28, 0.11);
  transform: translateY(-2px);
}

.ac-course.has-access {
  border-color: rgba(20, 33, 28, 0.22);
}

/* ---- 卡头：课次数徽标 + 开通进度 ---- */
.ac-course-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ac-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(20, 33, 28, 0.08);
  color: var(--muted, #65776f);
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.ac-count {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  color: var(--muted, #65776f);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.3;
}

.ac-count.is-on {
  color: #1f6f5c;
}

.ac-count .i18n-en {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.8;
  text-transform: none;
}

/* ---- 课程标题 ---- */
.ac-course h3 {
  margin: 0 0 14px;
  color: var(--ink, #14211c);
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  font-weight: 950;
  line-height: 1.42;
}

.ac-course h3 .i18n-en {
  display: block;
  margin-top: 5px;
  color: var(--muted, #65776f);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: none;
}

/* ---- 课次格子：每课一格，全部摊开，三态分明 ---- */
.ac-lessons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.ac-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "l t"
    "s s";
  align-items: center;
  gap: 3px 8px;
  border: 1px solid var(--line, rgba(20, 33, 28, 0.12));
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 11px;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ac-chip-l {
  grid-area: l;
  color: var(--muted, #65776f);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ac-chip-t {
  grid-area: t;
  overflow: hidden;
  color: var(--ink, #14211c);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-chip-s {
  grid-area: s;
  color: var(--muted, #65776f);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* 已开通：墨绿实心，最显眼 */
.ac-chip.is-on {
  border-color: transparent;
  background: linear-gradient(150deg, #1f3b32, #14211c);
}

.ac-chip.is-on .ac-chip-l,
.ac-chip.is-on .ac-chip-s {
  color: rgba(255, 255, 255, 0.72);
}

.ac-chip.is-on .ac-chip-t {
  color: #ffffff;
}

/* 免费体验课：金边 */
.ac-chip.is-free {
  border-color: rgba(248, 196, 93, 0.9);
  background: linear-gradient(150deg, #fffaf0, #fff3d8);
}

.ac-chip.is-free .ac-chip-s {
  color: #8a5c00;
  font-weight: 950;
}

/* 未开通：灰、不可点、不抢注意力 */
.ac-chip.is-off {
  background: rgba(20, 33, 28, 0.03);
  cursor: default;
}

.ac-chip.is-off .ac-chip-t {
  color: #7b8b83;
}

a.ac-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 107, 66, 0.6);
}

a.ac-chip.is-on:hover {
  border-color: rgba(248, 196, 93, 0.9);
}

/* ---- 卡脚：进入课程 + 登录提示 ---- */
.ac-course-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line, rgba(20, 33, 28, 0.12));
}

.ac-open {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--orange, #d96b42);
  color: #ffffff;
  padding: 12px 24px 13px;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.25;
  text-decoration: none;
  transition: filter 160ms ease, transform 160ms ease;
}

.ac-open:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.ac-open .i18n-en {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  opacity: 0.94;
  text-transform: none;
}

.ac-signin {
  color: #1f6f5c;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  border-bottom: 1px dashed rgba(31, 111, 92, 0.45);
  padding-bottom: 1px;
}

.ac-signin .i18n-en {
  display: block;
  margin-top: 2px;
  color: var(--muted, #65776f);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: none;
}

.ac-signin:hover {
  color: var(--orange, #d96b42);
  border-bottom-color: rgba(217, 107, 66, 0.5);
}

/* ---- 窄屏 ---- */
@media (max-width: 640px) {
  .ac-course {
    padding: 18px 16px 15px;
    border-radius: 22px;
  }

  .ac-lessons {
    grid-template-columns: minmax(0, 1fr);
  }

  .ac-course-top {
    align-items: flex-start;
  }

  .ac-count {
    align-items: flex-start;
    text-align: left;
  }

  .ac-open,
  .ac-signin {
    flex: 1 1 100%;
    text-align: center;
  }
}
