.course-detail-grid,
.chapter-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.course-detail-item,
.chapter-detail-item {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.course-detail-item.is-wide,
.chapter-detail-item.is-wide {
  grid-column: 1 / -1;
}

.course-detail-item-label,
.chapter-detail-item-label {
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 12px;
}

.course-detail-item-value,
.chapter-detail-item-value {
  color: #111827;
  line-height: 1.7;
  word-break: break-all;
}

.course-detail-media {
  display: grid;
  gap: 12px;
}

.course-detail-media img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
  background: #f8fafc;
}

.chapter-video-preview-player {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  background: #000;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.toolbar-filters select,
.toolbar-filters input {
  min-width: 180px;
  height: 38px;
}

.course-page-head {
  width: min(var(--shell), calc(100vw - 32px));
  margin: 0 auto;
  padding: 29px 28px 0;
  border: 1px solid var(--line-deep);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: var(--shadow);
}

.course-page-head h2 {
  margin: 0 0 18px;
  font-size: 32px;
  color: var(--blue);
}

.package-top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 18px;
}

.major-tabs {
  position: relative;
  display: flex;
  justify-content: flex-start;
  gap: 28px;
  margin: 29px 0 0;
  padding-bottom: 0;
  border-bottom: 0;
  background: #fff;
}

.major-tabs::before {
  content: "";
  position: absolute;
  left: -28px;
  right: -28px;
  bottom: 0;
  height: 1px;
  background: #061d31;
  pointer-events: none;
  z-index: 0;
}

.package-top-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #d8e5ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.package-top-tab.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.major-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 150px;
  padding: 0 24px;
  margin: 0;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: radial-gradient(circle at 20% 0%, rgba(31,103,151,.34), transparent 36%), linear-gradient(180deg, #09253d 0%, #061d31 100%);
  color: #f4fbff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 -6px 18px rgba(10,53,89,.06);
  isolation: isolate;
  z-index: 1;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.major-tab::before,
.major-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: transparent;
  pointer-events: none;
  z-index: -1;
}

.major-tab::before {
  left: -18px;
  border-bottom-right-radius: 18px;
  box-shadow: 7px 7px 0 7px #061d31;
}

.major-tab::after {
  right: -18px;
  border-bottom-left-radius: 18px;
  box-shadow: -7px 7px 0 7px #061d31;
}

.major-tab:hover {
  background:
    radial-gradient(circle at 20% 0%, rgba(71,173,235,.36), transparent 38%),
    linear-gradient(180deg, #0b3152 0%, #082844 100%);
  color: #fff;
}

.major-tab.active {
  color: var(--blue-deep);
  background: #fff;
  box-shadow: 0 -10px 26px rgba(10,53,89,.1), inset 0 4px 0 #061d31;
  z-index: 3;
}

.major-tab.active::before { box-shadow: 7px 7px 0 7px #fff; }
.major-tab.active::after { box-shadow: -7px 7px 0 7px #fff; }


.anchor-tabs {
  --quick-nav-h: 36px;
  --anchor-color: #073b66;
  position: sticky;
  top: 46px;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px minmax(40px, 1fr) max-content;
  width: min(var(--shell), calc(100vw - 32px));
  gap: 10px;
  align-items: center;
  margin: -1px auto 0;
  padding: 18px 28px 10px;
  border: 1px solid var(--line-deep);
  border-top: 0;
  border-bottom: 0;
  background: #fff;
}

.anchor-search {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: var(--quick-nav-h);
  min-height: var(--quick-nav-h);
  margin: 0;
  padding: 2px 24px 0 8px;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--anchor-color) 38%, transparent);
  border-radius: 0;
  background: linear-gradient(45deg, transparent 48%, var(--anchor-color) 50%, var(--anchor-color) 62%, transparent 64%) right 12px center / 8px 8px no-repeat,
    linear-gradient(-45deg, transparent 48%, var(--anchor-color) 50%, var(--anchor-color) 62%, transparent 64%) right 6px center / 8px 8px no-repeat;
  color: var(--anchor-color);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  transform: none;
  outline: 0;
  box-shadow: none;
}

.anchor-search:focus {
  border-bottom-color: var(--anchor-color);
  box-shadow: none;
}

.anchor-search::placeholder {
  color: var(--anchor-color);
  opacity: 1;
}

.buy-large {
  gap: 8px;
  min-width: 120px;
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #2387d7, #0a4f88);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 16px 30px rgba(13,79,136,.22);
}

.buy-large > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.buy-large-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.course-buy-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 250px;
  justify-self: end;
}

.package-total-pill {
  order: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff3c4;
  color: #8a5a00;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(184, 123, 0, .12);
}

.course-buy-stack .buy-large {
  order: 2;
}

.package-total-pill strong {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.package-total-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d49b12;
  position: relative;
  flex: 0 0 22px;
}

.package-total-icon::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: #fff8dc;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 7.5 10h3L7 16h3v5h4v-5h3l-3.5-6h3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 7.5 10h3L7 16h3v5h4v-5h3l-3.5-6h3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.course-package-shell {
  width: min(var(--shell), calc(100vw - 32px));
  margin: -1px auto 0;
  padding: 0 28px 26px;
  border: 1px solid var(--line-deep);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.public-course-card-panel {
  padding-top: 22px;
}

.public-course-grid {
  align-items: stretch;
}

.course-kind-block + .course-kind-block {
  margin-top: 22px;
}

.course-kind-title {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 14px;
  color: #073b66;
  font-size: 22px;
  font-weight: 900;
}

.course-card.front-course-card {
  overflow: hidden;
  display: grid;
  gap: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.course-img {
  position: relative;
  min-height: 190px;
  background: #dbe8f5 center/cover;
}

.course-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #d92d20;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 18px rgba(7, 59, 102, 0.12);
}

.course-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.course-title {
  color: var(--text);
  font-size: 19px;
  line-height: 1.35;
}

.course-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-action {
  color: var(--blue);
  font-weight: 800;
}

.course-cover-field {
  grid-column: span 2;
}

.course-description-field .tox-tinymce {
  min-height: 520px;
}

.table-actions .btn {
  min-width: 54px;
}

.home-selection-modal {
  padding: 0;
  overflow: hidden;
}

.home-selection-modal .modal-head {
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid #e4edf6;
}

.home-selection-modal .modal-head h3 {
  margin: 0;
  color: #073b66;
  font-size: 22px;
}

.select-modal-content {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 18px 22px 0;
}

.select-modal-head {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f5f9fd;
  color: #41576e;
  line-height: 1.8;
}

.package-select-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.package-select-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

.package-select-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.package-select-card {
  display: grid;
  gap: 14px;
  min-height: 480px;
  border: 1px solid #dbe7f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(7, 59, 102, 0.08);
}

.package-select-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
  color: #073b66;
  font-size: 20px;
  font-weight: 800;
}

.package-section-total {
  color: #b42318;
}

.package-group-grid,
.package-major-grid {
  display: grid;
  gap: 12px;
  padding: 0 20px 20px;
}

.main-group-toggle,
.course-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #dbe7f2;
  border-radius: 14px;
  background: #f9fbfd;
  color: #18364b;
}

.main-group-toggle strong,
.course-check strong {
  color: #b42318;
  white-space: nowrap;
}

.course-category-item {
  border: 1px solid #dbe7f2;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.package-major-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: #f7fafc;
  color: #073b66;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.package-major-arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid #7b8ca3;
  border-bottom: 2px solid #7b8ca3;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.course-category-item.open .package-major-arrow {
  transform: rotate(225deg);
}

.package-major-body {
  display: none;
  padding: 0 16px 16px;
}

.course-category-item.open .package-major-body {
  display: block;
}

.course-check-group {
  display: grid;
  gap: 10px;
}

.course-check-empty {
  padding: 16px;
  color: #7b8ca3;
  text-align: center;
}

.select-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid #e4edf6;
  background: #fff;
}

.select-modal-footer .btn {
  min-height: 42px;
  line-height: 1;
}

.purchase-confirm-btn {
  gap: 8px;
  padding-left: 18px;
  padding-right: 20px;
}

.purchase-confirm-btn > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.purchase-confirm-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.select-total {
  margin-right: auto;
  color: #073b66;
  font-size: 22px;
}

.select-total span {
  margin-left: 6px;
  color: #b42318;
}

@media (max-width: 920px) {
  .anchor-tabs {
    grid-template-columns: 1fr;
  }

  .package-select-grid {
    grid-template-columns: 1fr;
  }

  .select-modal-content {
    max-height: calc(100vh - 260px);
  }

  .select-modal-footer {
    flex-wrap: wrap;
  }

  .select-total {
    width: 100%;
  }
}
