/* 出海课程目录页：桌面复刻参考页骨架，移动端切换为媒体列表 */
.course-catalog-page { background: #fff; }
.course-catalog-shell { padding: 22px 0 80px; }
.course-catalog-breadcrumb { margin-bottom: 12px; color: var(--ink-3); font-size: 13px; }

.course-view-tab:focus-visible,
.course-page-arrow:focus-visible,
.course-page-number:focus-visible,
.course-page-jump input:focus-visible {
  outline: 3px solid rgba(4,75,199,.28); outline-offset: 3px;
}

.course-view-tabs {
  display: flex; align-items: flex-end; gap: 32px; min-height: 44px; margin-bottom: 16px;
  border-bottom: 1px solid transparent;
}
.course-catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.course-catalog-head .course-view-tabs { flex: 1 1 auto; min-width: 0; }
.course-catalog-actions { flex: 0 0 auto; margin-bottom: 16px; }
.course-catalog-actions .qhz-redeem-trigger {
  position: relative; min-height: 36px; padding: 0 14px; border: 1px solid var(--blue); border-radius: 7px;
  color: #fff; background: var(--blue); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.course-catalog-actions .qhz-redeem-trigger:hover { color: #fff; border-color: var(--navy); background: var(--navy); }
.course-view-tab {
  position: relative; align-self: stretch; padding: 9px 0 13px; border: 0;
  color: var(--ink-2); background: transparent; font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.course-view-tab::after {
  content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px;
  background: transparent; transform: scaleX(.35); transition: transform .24s var(--ease), background .24s var(--ease);
}
.course-view-tab:hover { color: var(--blue); }
.course-view-tab.is-active { color: var(--blue); }
.course-view-tab.is-active::after { background: var(--blue); transform: scaleX(1); }

.course-catalog-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
}
.course-catalog-card {
  position: relative;
  display: flex; flex-direction: column; min-width: 0; min-height: 300px; height: auto; overflow: hidden;
  border: 1px solid #E1E5EB; border-radius: 8px; background: #fff;
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.course-catalog-card[hidden],
.course-catalog-empty[hidden],
.course-pagination[hidden] { display: none !important; }
.course-catalog-card:hover {
  transform: translateY(-2px); border-color: rgba(15,54,122,.28); box-shadow: 0 8px 22px rgba(15,54,122,.08);
}
.course-catalog-card:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(15,54,122,.06); }
.course-catalog-card:focus-visible { outline: 3px solid rgba(4,75,199,.28); outline-offset: 3px; }
.course-catalog-cover {
  position: relative; flex: 0 0 auto; aspect-ratio: 5 / 3; overflow: hidden;
  margin: 0; background: #E9EEF8;
}
.course-catalog-status {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px;
  border: 1px solid rgba(255,255,255,.72); border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15,54,122,.09);
}
.course-catalog-status.is-purchased { color: #1b6b3b; background: rgba(238,250,242,.96); }
.course-catalog-status.is-locked { color: #637087; background: rgba(248,250,252,.96); }
.course-catalog-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s var(--ease);
}
.course-catalog-card:hover .course-catalog-cover img { transform: scale(1.035); }
.course-catalog-cover > .course-cover-placeholder { min-height: 0; height: 100%; font-size: 12px; }
.course-catalog-card-body {
  display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; padding: 11px 15px 13px;
}
.course-catalog-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.course-catalog-title h2 {
  min-width: 0; color: var(--navy); font-size: 15.5px; font-weight: 700;
  line-height: 22px; white-space: normal; overflow-wrap: anywhere;
}
.course-catalog-meta {
  margin-top: 8px; overflow: hidden; color: var(--ink-3); font-size: 12.5px; line-height: 20px;
  text-overflow: ellipsis; white-space: nowrap;
}
.course-catalog-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto;
  color: #8995A7; font-size: 12px; line-height: 20px;
}
.course-catalog-card-foot > span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.course-catalog-card-foot > strong {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  min-height: 30px; padding: 0 10px; border: 1px solid rgba(4,75,199,.22); border-radius: 5px;
  color: var(--blue); background: #F7FAFF; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.course-catalog-card:hover .course-catalog-card-foot > strong {
  color: #fff; border-color: var(--blue); background: var(--blue);
}

.course-catalog-empty {
  display: grid; gap: 7px; margin: 48px 0; padding: 42px 20px; border: 1px dashed #BFCBE0; border-radius: 10px;
  color: var(--ink-3); background: #F7F9FC; text-align: center;
}
.course-catalog-empty strong { color: var(--navy); font-size: 17px; }
.course-catalog-empty span { font-size: 14px; }
.course-catalog-empty span:empty { display: none; }
.course-catalog-empty-actions { display: flex; justify-content: center; margin-top: 9px; }
.course-catalog-empty-actions[hidden] { display: none !important; }
.course-catalog-empty-actions .course-access-wecom {
  border-color: var(--brand-red); color: #fff; background: var(--brand-red);
}
.course-catalog-empty-actions .course-access-wecom:hover { color: #fff; background: #b80f20; }

.course-pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 32px;
}
.course-page-arrow,
.course-page-number {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); background: #fff;
  font: inherit; font-size: 13px; cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.course-page-arrow:hover:not(:disabled),
.course-page-number:hover { color: var(--blue); border-color: #BFCBE0; background: #EEF2F8; }
.course-page-arrow:disabled { color: #B8C0CC; background: #F7F8FA; cursor: not-allowed; }
.course-page-numbers { display: inline-flex; gap: 8px; }
.course-page-number.is-active { color: #fff; border-color: var(--blue); background: var(--blue); }
.course-page-jump {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; color: var(--ink-2); font-size: 13px;
}
.course-page-jump input {
  width: 50px; height: 36px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--navy); background: #fff; font: inherit; text-align: center;
}

@media (max-width: 1099px) {
  .course-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-catalog-card { height: auto; min-height: 300px; }
}

@media (max-width: 768px) {
  /* Keep short catalogues above a naturally sized footer. */
  body.qhz-course-catalog-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 0;
  }
  body.admin-bar.qhz-course-catalog-body {
    min-height: calc(100vh - 46px);
    min-height: calc(100dvh - 46px);
  }
  body.qhz-course-catalog-body .course-catalog-page {
    flex: 1 0 auto;
    width: 100%;
  }
  body.qhz-course-catalog-body .site-footer {
    flex: 0 0 auto;
    width: 100%;
  }

  .course-catalog-page { min-height: 0; }
  .course-catalog-shell { min-height: 0; padding: 0 0 28px; }
  .course-catalog-shell > .container { padding-right: 16px; padding-left: 16px; }
  .course-catalog-breadcrumb { display: none; }

	.course-catalog-head { display: block; }
	.course-catalog-actions { display: flex; justify-content: flex-end; margin: -8px 0 12px; }
	/* Keep the original 36px appearance with a 44px mobile hit area. */
	.course-catalog-actions .qhz-redeem-trigger::before { content: ''; position: absolute; inset: -4px 0; }

  .course-view-tabs {
    display: flex; min-height: 48px; gap: 24px; margin: 0 0 18px;
    overflow-x: auto; border-bottom-color: var(--line); scrollbar-width: none;
  }
  .course-view-tabs::-webkit-scrollbar { display: none; }
  .course-view-tab {
    flex: 0 0 auto; min-height: 44px; padding: 9px 0 12px;
    font-size: 15px; line-height: 22px;
  }

  .course-catalog-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .course-catalog-card {
    display: grid; grid-template-columns: clamp(96px, 27vw, 120px) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto; column-gap: 12px; row-gap: 0;
    width: 100%; height: auto; min-height: 0; margin-bottom: 0; overflow: visible;
    padding: 12px; border: 1px solid #E1E5EB; border-radius: 10px;
    background: #fff; box-shadow: none;
  }
  .course-catalog-card:hover,
  .course-catalog-card:active {
    transform: none; border-color: #E1E5EB; box-shadow: none;
  }
  .course-catalog-cover { grid-column: 1; grid-row: 1 / 3; width: 100%; align-self: start; border-radius: 6px; }
  .course-catalog-card:hover .course-catalog-cover img { transform: none; }
  .course-catalog-card-body { display: contents; }
  .course-catalog-title { grid-column: 2; grid-row: 1; align-items: flex-start; min-height: 0; }
  .course-catalog-title h2 {
    display: block;
    flex: 1 1 auto;
    font-size: 15px;
    line-height: 22px;
    white-space: normal;
  }
  .course-catalog-meta {
    grid-column: 2; grid-row: 2; align-self: start;
    display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: #65748A;
    font-size: 13px; line-height: 20px; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .course-catalog-card-foot {
    grid-column: 1 / -1; grid-row: 3; gap: 10px;
    margin-top: 10px; padding-top: 9px; border-top: 1px solid #EDF0F5;
    font-size: 12px; line-height: 20px;
  }
  .course-catalog-card-foot > .course-catalog-status {
    position: static; flex: 0 0 auto; min-height: 20px; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
    font-size: 12px; font-weight: 500; line-height: 20px;
  }
  .course-catalog-card-foot > .course-catalog-category { flex: 1 1 auto; color: #65748A; }
  .course-catalog-card-foot > .course-catalog-category:empty { display: none; }
  /* The whole card remains the link; the footer provides a quiet action cue. */
  .course-catalog-card-foot > strong,
  .course-catalog-card:hover .course-catalog-card-foot > strong {
    gap: 6px; min-height: 24px; margin-left: auto; padding: 0;
    border: 0; border-radius: 0; color: var(--blue); background: transparent;
    font-size: 13px; line-height: 20px;
  }
  .course-catalog-card-foot > strong::after { content: '\2192'; font-size: 16px; font-weight: 400; }

  .course-pagination {
    gap: 48px; margin: 18px -16px 0; padding: 14px 16px 4px; border-top: 1px solid #E9EDF3;
  }
  .course-page-arrow { width: 44px; height: 44px; border: 0; border-radius: 8px; }
  .course-page-arrow svg { width: 26px; height: 26px; }
  .course-page-numbers,
  .course-page-jump { display: none; }
}

@media (max-width: 359px) {
  .course-catalog-card { column-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .course-view-tab::after,
  .course-catalog-card,
  .course-catalog-cover img,
  .course-page-arrow,
  .course-page-number { transition: none; }
}

/* Trial discovery remains prominent in both the desktop grid and mobile list. */
.course-catalog-card.has-trial .course-catalog-card-foot > strong.is-trial-action {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--brand-red, #d80b24);
  border-radius: 6px;
  color: #fff;
  background: var(--brand-red, #d80b24);
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(216, 11, 36, .18);
}

.course-catalog-card.has-trial:hover .course-catalog-card-foot > strong.is-trial-action,
.course-catalog-card.has-trial:focus-visible .course-catalog-card-foot > strong.is-trial-action {
  border-color: #b80f20;
  background: #b80f20;
}
